aspose file tools*
The moose likes JSP and the fly likes A problem about JSP document (jspx) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "A problem about JSP document (jspx)" Watch "A problem about JSP document (jspx)" New topic
Author

A problem about JSP document (jspx)

Frank Jp Zheng
Greenhorn

Joined: Feb 05, 2010
Posts: 2
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

Joined: Jan 10, 2002
Posts: 60057
    
  65

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Frank Jp Zheng
Greenhorn

Joined: Feb 05, 2010
Posts: 2
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

Joined: Jan 10, 2002
Posts: 60057
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A problem about JSP document (jspx)
 
Similar Threads
error in jstl while writing c:if
JSTL problem
login page
adding a servlet
HTTP Status 404 The requested resource is not available