It is quite handy to handle exceptions in struts, whether it's struts1 or struts2, and configuring global exceptions is OK ~
To print out the exception information in the page:
The processing method in Struts1:
Direct use of tags in struts2:
:
SetAttribute (String name,object): Sets the parameter value of the request named name
GetAttribute (String name): Returns the property value specified by name
Getattributenames (): Returns a collection of names for all properties of the request
1. Introduction
The include directives in the JSP are in the form of:Typically, include is considered when parts of all pages in an application, such as headers, footers, and navigation bars, are the same. The include directive element of the ,jsp
1. Introduction
Include action directives can dynamically include a file in a JSP page, the contents of which can be static files or dynamic scripts, and the JSP engine can dynamically compile and update the included dynamic files when they are
Problem:In the Struts2 failed, not only turn the past also reported 404 errors. I do not know if it is not supported in STRUTS2 or requires additional configuration.
Reason:Because Struts2 uses a filter to handle requests, the default is to
Request is an object that encapsulates the requested data and attributes submitted by the client side (that is, the user through browser).
response are objects that encapsulate Web server-side response data and
1. Actioncontext
In STRUTS2 development, in addition to automatically setting request parameters to action fields, we often need to get some information directly from the action (request) or session (sessions), or even directly to Javaservlet HTTP
Some time ago in the use of Struts2, more is considered by the JSP get action stored in the session or request key.
Such as:
Public String getinfbysal () {
Connection con = oracleconnectionmanager.getconnection ();
Userdao Userdao = new Userdao ();
The Java Web project was deployed to Tomcat and a org.apache.jasper.JasperException:java.lang.NullPointerException error occurred while starting the Tomcat open JSP page. This is because some of the packages loaded in build path in the project are
If you want to upload an object, list, or string from the Struts2 action to the JSP page, simply define the object, list, or string in the action, and then generate the Get,set method. So that the page can be obtained. For example:
public class
Calling through JavaScript
First step: Copy the FCKeditor resource folder to Webroot
Step two: fetching JavaScript files
Step three: Output code for JavaScript calls.
Method One: Create and enter an editor.
Method Two: Replace a testarea element
characteristic
struts1.x
Struts2
Action class
struts1.x requires the action class to be extended from an abstract base class. A common problem with struts1.x is programming for abstract classes rather than interface-oriented
The internet age is actually the era of data, the construction of large-scale e-commerce system must involve a large number of data display, data paging is frequently encountered problems, if each programmer to consider data acquisition and
Just a preliminary understanding of the JSP nine objects, such as the ASP simple page program to find data written out should be no problem, but there is a problem has been puzzling me, that is how to deploy JavaBean? In the afternoon to see the
Summary of JSP page jump1. Requestdispatcher.forward () acts on the server side, and when using forward (), the Servlet engine passes HTTP requests from the current servlet or JSP to another servlet, JSP or normal HTML file, that is, your form
Using FCKeditor in a JSP
1.1 Runtime Commons-fileupload-1.1.jar Fckeditor-2.3.jar 1.2 Editor Version FCKeditor 2.0 FCKeditor is an online editor that contains almost all of the online editors that are now online, The realization of the function is
Idea: Use JavaScript to modify the form's action path, and then start form's submit () Event Submission Form
JS Code
function Action1 () {
document. Mform.action= "action1.action";//modify Path
document. Mform.submit ();//Commit form[name=mfrom]
The page directive is used to define global properties in the JSP file. A JSP page can contain multiple page directives, except for the Import property, which can occur only once.
[language= "Java"]//setting (declaring) language type
[import=
The value of the action attribute of the form label in the JSP form, which is the path to the method in the Action Class (path), is known to be related to the path in struts's configuration file, which has the code to load the struts profile in
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