"Encapsulates an INPUT element in a Web page as a (request) data Object", an object that isThe actioninvocation type.For Xwork, the webwork component of the front-end provides a data structure of a map type. The action is oriented to the data structure provided by the model object. When and where do you convert these two different data structures?Write a helper class to do the work, and call him to complete the conversion work before each action call
Development Based on the webwork spring hibernate ProjectThe combination of the three should be the best java web programming mode.
First, describe their respective roles:
1. hibernate is responsible for database operations
2. spring is responsible for real business operations
3. webwork is responsible for transferring requests and returning spring processing results to users.
In the past development, many
One problem found today is that the calendar plug-in webwork cannot be displayed through IHS (connected to WebSphere via plug-ins. Red Cross is displayed on the page. If you use port 9080 of was, you can access the service normally. The problem must be indicated by IHS.
First, the packet capture tool fiddler2 found that the returned length of the calendar. js file of webwork under IHS is 0, indicating
Implementation Method1. Add the following configuration information to struts. xml or xwork. xml:2. Add the proxy method to the BaseAction class.Private ActionProxy proxy;Public ActionProxy getProxy (){If (proxy = null)Proxy = ActionContext. getContext (). getActionInvocation (). getProxy ();Return proxy;}
3. To create a JSP file, the file name must be the same as the action method name, for example, a. jap.Public String a () throws Exception {Return AUTO;}4. On a Jsp page, call the method witho
Web| Solutions | questions | Chinese
Webwork+velocity Chinese Problem Resolution: 1, Webwork.properties file, add:
webwork.i18n.encoding = GB2312
It is primarily used to set the encoding of the WebWork UI tag library If it is not set to pass
System.getproperty ("file.encoding") to obtain the default character encoding. 2, Velocity.properties file, add:
input.encoding=gb2312
output.encoding=gb2312
defa
Development Process:
1) install JDK, eclipse, and other development platforms and environments;2) create a project: New-> myeclipse-> Web project;3) Import spring Library: myeclipse-> Add spring capabilities, the default applicationcontext. XML will be generated under the WEB-INF;4) copy the jar related to spring and webwork to the lib directory under the WEB-INF, will generate the. classpath file under the project;5) configure the web under the WEB-
According to some tips on the official website, following these steps can improve the performance of struts2. Because struts2 inherits webwork, so webwork is the same.
1. Disable Logging and devmode. devmode is set in struts. properties. To Disable Logging, modify the Web. xml file and add the following parameters.
2. Do not use interceptor unless necessary ).
3. correctly set cache-control and expires
Now still in use WEBWORK2, these days want to write their own upload code to reorganize, packaging, as a component to use, later on in the code rewrite, today want to put my upload components into the WEBWORK2, But there is a problem: the request in WEBWORK2 's action is resolved, not the most primitive httpservletrequest, I use (commons-fileupload) Servletfileupload, get the file list is always 0, looking for a long time to know is Webwork.multipart.parser make ghost, because
not realized that this is actually a remote code execution vulnerability. ognl not only supports modification, but also supports executing some static methods, such as @runtime@getruntime(cmd.exe c ("calc ").
Second repair
Until one day, it may be in version xwork2.1.2 that the official team secretly modified the Security Configuration. By default, the value of allowStaticMethodAccess of SecurityMemberAccess (class for managing ognl permissions) is false, which causes the static method to fail
1. Required Software
1. JDK 1.4.2 or later
2. Eclipse 3.1.2
3. Tomcat's Eclipse platform plugin com.sysdeo.eclipse.tomcat_3.0.0
4. Tomcat version 5.5.16
5. Download Webwork2.2.2, http://www.opensymphony.com/webwork/ 2. JDK installation
Execute the J2SDK Setup program, and then install it by default.
After installing the J2SDK, you need to configure the environment variables and add the following environment variables to the system variables, such as
. Threadlocal can be named "Thread Local variable". It provides a copy of the variable value for every thread that uses this variable, so that each thread can change its own copy independently, it does not conflict with copies of other threads. In this way, the attributes in our actioncontext will only be visible in the corresponding current request thread to ensure its thread safety. Next let's take a look at how to get our httpsession through actioncontext: Map session = actioncontext. getcont
Use the unit test framework JUnit to perform unit tests on webwork actions. Public void testsearch () throws exception ...{
Map Params = new hashmap ();
// Unit. setname ("tttuu ");
// Set all required parameters
Params. Put ("unit", Unit );
Params. Put ("locationcode", "1 ");
Params. Put ("yhtunitmanager", yhtunitmanager );
// Create the container of the actioncontext Context
Map extracontext = new hashmap ();
Extracontext. Put (actioncontext. parame
In webwork, you only need to include other configuration files in xwork. XML, such:
For Multiple Spring configuration files, you only need to define them in the web. xml file as follows: /WEB-INF/applicationcontext *. xml
You can implement multiple configuration files starting with applicationcontext.
Dreamweaver
The webpage is good, but only the default labels are used.
Webwork
When you tag, you need to slowly push it up, seriously affecting the work efficiency. Is there a way to make
Dreamweaver
Supported by default
WW
The tags are found online, and all the searched results are
Dw4
You must edit it yourself.
DW
Of
Tag
File, really boring. Later
DW
The "tag library" option is found in the "edit" menu.
WW
Of
TLD
After clicking the Upload button, the WebWork program flow is as follows:
Step 1) into the Servletdispatcher.service
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException { ........ request = wrapRequest(request); ......... }
STEP2) into the Servletdispatcher.wraprequest
protected HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException { ........................ if (MultiPartReq
Javebean
Package ch9;
public class Testbean ... {
private String name;
Private String age;
Public String getage () ... {
return age;
}
public void Setage (String age) ... {
This.age = age;
}
Public String getName () ... {
return name;
}
public void SetName (String name) ... {
THIS.name = name;
}
}
Action:
Separately constructs List,set,map three most commonly used collection, needs to note is the WebWork Traversal map label is according to the key
Recently I made a small web project, and found many unreasonable aspects in the development process. I would like to make a small summary when I have time:1) easily tested damage of webworkThis is one of the most common stupid mistakes in my design. Originally, webwork was famous for its ease of testing. However, in my design, it always provided servlectcontext intrusion. The most common example is to generate staticArticle. Because it is necessary to
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