Struts development highlights

Source: Internet
Author: User

1. cocould not load class Interceptor2/Myinterceptor. Perhaps it exists but certain dependencies are not available? -Interceptor

Solution: log4j. jar is missing.

2. When your action processing class inherits ActionSupport

Public class Reg extends ActionSupport {
Private String username;
Private String mymsg;
Private String password1;
Private String password2;
Private Date birthday;


Public String execute () throws Exception {}


". Action" must be added to the action of the form <s: form id = "id" action = "Interceptor2/reg. action">


Otherwise

Type Status report

Message/Test/xInterceptor2/reg. jsp

Description The requested resource (/Test/xInterceptor2/reg. jsp) is not available. Error

3

In versions earlier than struts2de 1.6, the <s: datepicker> label is used to obtain the time. After 1.8, the <sx: datetimepicker> label in the struts-dojo.plugin can be used to obtain the time.

1. struts2-dojo-plugin-2.1.6.jar is introduced into your own project.
2. Add the following content to jsp:
<% @ Page language = "java" pageEncoding = "UTF-8" %>
<% @ Taglib prefix = "s" uri = "/struts-tags" %>
<% @ Taglib prefix = "sx" uri = "/struts-dojo-tags" %>
3. Add the following to

<Head>
<S: head theme = "xhtml"/>
<Sx: head parseContent = "true"/>
</Head>
4. Use in the page
<Sx: datetimepicker name = "birthday" lable = "request time" displayFormat = "yy-MM-dd"/>


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.