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
"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
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-
Remote Code Execution (Struts2/XWork
Principles:
1. the user submitted u0023 and escaped it as \ u0023. After verifying the parameter name, The ognl becomes u0023, that is, #, and complies with the ognl syntax.
2. By executing Ognl statements, you can overwrite some default configurations in the ognl context when running struts2 and webwork. The vulnerability discoverer provides a number of override values.
3. Although static method execution is d
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
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
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 tag Interface Component Library provided by webwork is not powerful and practical. However, when some general systems are built, the corresponding action mechanism of webwork components cannot fully meet the requirements. In many general systems, interfaces are usually generated in batches rather than manually. In this way, developers cannot determine which fields to set in the action. At the same time,
The webwork tag library is divided into seven categories:General tags: The most common and basic tags;Componentized labels: Encourage componentization of views;Process control Tag: Manage the control process on the JSP page;Iteration Tag: iterates elements and operates iterable objects;Ui Tag: generate HTML form fields and controls;VUI labels: After webwork2.0, VUI labels have been removed from webwork beca
I checked the source code of the webwork File Upload part and found that it saved the error information. The front-end FTL called it and it was OK. However, the more errors found, I thought it was caused by addfielderror of webwork. I wanted to clear the error information after it was displayed. However, because the entire processing process is encapsulated by webwork
Web| News
In general, WebWork uses field-driven or model-driven methods to get data from a form. (Plain form)However, in some cases, the field name content that needs to be edited is dynamic, and there is no way to use a defined class for mapping.At this point I think of the following ways to solve: 1. Use WebWork internal objects, remove all parametersActioncontext context = Actioncontext.getcontext ();Ma
actioncontextthreadlocal ();, actioncontextthreadlocal is an internal class that implements threadlocal. 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
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
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.