Modify template:
Find com. genuitec. Eclipse. wizards_9.0.0.me201108091322.jar. At least the format is the same, and each version is different. My name is myeclipse10.
Open it with the War software.
Create a struts2_jsp.vtl
Struts2_jsp.vtl
------------------------------------- JSP code
- <% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "UTF-8" contenttype = "text/html; charset = UTF-8" %>
- <% @ Taglib prefix = "S" uri = "/Struts-tags" %>
- <%
- String titlestring = "My struts2 JSP template ";
- String footerstring = "My struts2 JSP template ";
- String Path = request. getcontextpath ();
- String basepath = request. getscheme () + ": //" + request. getservername () + ":" + request. getserverport () + path + "/";
- %>
- <HTML>
- <Head>
- <Title> <% = titlestring %> </title>
- </Head>
- <Body>
- <Center>
- <HR>
- <% = New date () %> <br>
- Actionerror: <s: actionerror/> <br>
- Actionmessage: <s: actionmessage/> <br>
- <HR>
- <Div style = "height: 100%; Border: 1px solid # 6699ff">
- <S: Form Action = "myaction" method = "Post">
- <S: textfield name = "user" label = "username" value = "Default Value" size = "50"> </S: textfield>
- <S: Submit value = "Submit"> </S: Submit>
- </S: Form>
- </Div>
- <HR>
- <Center> <% = footerstring %> </center>
- </Body>
- </Html>
Then put the file in the jar file com. genuitec. Eclipse. wizards_9.0.0.me201108091322.jar \ Templates \ JSP
Return to com. genuitec. Eclipse. wizards_9.0.0.me201108091322.jar and see templates. xml
Decompress the package and click <! -- JSP templates --> is followed by the following code: XML Code
- <Template
- Context = "com. genuitec. Eclipse. Wizards. jsp"
- Script = "templates/JSP/struts2_jsp.vtl"
- Name = "Standard JSP using struts 2.x with a form"/>
Save the file and overwrite the file in the same place as the jar opened by war.
Start myeclipse, click New/JSP, and then select the template.