Add and modify JSP templates in myeclipse for Mac

Source: Internet
Author: User
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

  1. <% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "UTF-8" contenttype = "text/html; charset = UTF-8" %>
  2. <% @ Taglib prefix = "S" uri = "/Struts-tags" %>
  3. <%
  4. String titlestring = "My struts2 JSP template ";
  5. String footerstring = "My struts2 JSP template ";
  6. String Path = request. getcontextpath ();
  7. String basepath = request. getscheme () + ": //" + request. getservername () + ":" + request. getserverport () + path + "/";
  8. %>
  9. <HTML>
  10. <Head>
  11. <Title> <% = titlestring %> </title>
  12. </Head>
  13. <Body>
  14. <Center>
  15. <HR>
  16. <% = New date () %> <br>
  17. Actionerror: <s: actionerror/> <br>
  18. Actionmessage: <s: actionmessage/> <br>
  19. <HR>
  20. <Div style = "height: 100%; Border: 1px solid # 6699ff">
  21. <S: Form Action = "myaction" method = "Post">
  22. <S: textfield name = "user" label = "username" value = "Default Value" size = "50"> </S: textfield>
  23. <S: Submit value = "Submit"> </S: Submit>
  24. </S: Form>
  25. </Div>
  26. <HR>
  27. <Center> <% = footerstring %> </center>
  28. </Body>
  29. </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

  1. <Template
  2. Context = "com. genuitec. Eclipse. Wizards. jsp"
  3. Script = "templates/JSP/struts2_jsp.vtl"
  4. 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.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.