• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A problem about JSP document (jspx)

 
Frank Jp Zheng
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My task is to convert a jsp page to jspx document. All I need to do comes from a book. The greeting.jspx should do the exact what index.jsp does. My problem is that the browser just display a simplized xml-format text file when the jspx is loaded. Can anybody give me some clues? Thanks a lot in advance.

The code of my jsp page - index.jsp, which works well.



The code of the corresponding JSP DOCUMENT - greetings.jspx:


The code of the relevant web.xml:


The result displayed in browser when greetings.jspx is loaded:

<?xml version="1.0" encoding="UTF-8" ?>
- <html>
- <head>
<title>Hello</title>
</head>
- <body bgcolor="white">
<img src="duke.waving.gif" />
<h2>My name is Duke. What is yours?</h2>
- <form method="get">
<input size="25" name="username" type="text" />
<p />
<input value="Submit" type="submit" />
<input value="Reset" type="reset" />
</form>
</body>
</html>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank Jp Zheng wrote:My task is to convert a jsp page to jspx document.

By hand? Why?

The JSP document format is not meant for hand coding. It's either meant to be an intermediate format, or a format for tools that will automatically generate JSP (since building up a DOM is easy under code control is easier for building strings).

The format is not meant to be used in place of JSP.
 
Frank Jp Zheng
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault,

Thanks for your reply.
I am woking on the task by hand because it is required by the instructor of our JEE course and it will be helpful to understand jsp and jspx deeply.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, good luck with your question. Be aware that in the real world, no one uses jspx format for hand-coded JSP pages.

P.S. Please be sure to use color for emphasis, not your entire post. I have removed the color for you so that your post is more readable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic