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
Way1: Embed Java code inside
The JSP page embeds the following code:
Test Cases:
Way2: via El expression
An explanation of the syntax for El expressions see: http://blog.csdn.net/qwerasdf123/article/details/4189889
Add the following code
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 ();
Look at the contents of the form:
ABCD
--------------------------------------------------------------------------------------------------------------- ---
The main code for SHOW.JSP is:
Your choice is: ${param.select}
-------------------------------
The compilation environment is eclipse.
First in the JSP page, make the following settings:
This allows you to obtain the directory of your project, if your project name is TestStruts2, then the BasePath value is:
Basic">
Basic is the configuration in the Fckconfig.js in the Fckeditor.jar package, you can select Basic (Slim) or defaul (all works).
Put the value from the data to the FCK in the foreground page and modify it to write
${theme.themename}"/>
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
1, what is JavaBean
JavaBean is an important component in Java that can be cross-platform, and it is a component architecture. JavaBean in the server side of the application shows a strong vitality, in the JSP program commonly used to encapsulate
FCKeditor is a WYSIWYG text editor that is specifically designed to be in the open source code on a Web page. It is focused on lightweight and does not require too complex installation steps to be used. It can be combined with different programming
A simple reflection method in one of its own JSP was used to display the property method constructor of a class, as follows:
void Reflectapi (Javax.servlet.jsp.JspWriter out,string className) throws exception{Class Cls=class.forname
1. Why do I need page instruction
In the Java file, how to introduce a class from another package.
In the JSP file, how to introduce a class from another package.
(1), using the Import keyword, its advantages are: a reference, used everywhere.
(2),
It took me two days to figure out how to preview the picture.
Task requirements are as follows: There is a picture on the 1:jsp page (pic_1)
2: Click on the picture to eject the interface similar to the resource manager
3: Preview After selecting a
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
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
Original: http://www.gpxz.com/diannao/biancheng/261225.html
To automatically generate static pages, it is a good idea to intercept JSP requests with filter and preprocess them first to generate HTML automatically. An easy way to think about this is
Basic syntax for JSP:
1. JSP expression: Provides a way to directly calculate the Java variable or expression to the client's simplified way, it will output the variable
Or an expression is encapsulated directly in the .
2. Methods:
Object
One, servlet developmentThe user enters a URL in the browser and returns, and the browser sends an HTTP request to the server. The server-side program accepts the request, processes the request, and then sends a response. The browser receives a
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