Solved

convert servlet to jsp

Posted on 2004-08-22
8
443 Views
Last Modified: 2010-05-18
Hi,
I have worked with servlets and jsp and I really wanted to know whether there is any way to convert a servlet to jsp automatically.

thanks
sanjana
0
Comment
Question by:itc307
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 27

Accepted Solution

by:
rrz earned 84 total points
ID: 11864258
>automatically
I don't think so.    
But, please give us an small example of a servlet that you want to convert. Maybe someone will have an idea.        rrz
0
 

Author Comment

by:itc307
ID: 11864419
i was talking about a general servlet. Like for example, jsp pages automatically gets converted to servlets.

sanjana
0
 
LVL 27

Expert Comment

by:rrz
ID: 11864559
>jsp pages automatically gets converted to servlets.
Yes, Tomcat (or whatever you are using) sees the JSP tags that your page uses and translates them into Java code to put into the servlet. But, the reverse is a different matter.  I am not saying it is impossible, just that it would be very difficult.             rrz
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:kumvjuec
kumvjuec earned 83 total points
ID: 11864586
It would be easy since you only have to put the code in <% and %> except for the imports for which one has to put the <%@page import tag.
Although I wonder why would anyone want to do that?
For a some similar discussion, see this

http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20907938.html
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 83 total points
ID: 11867831
>  It would be easy

So long as the servlet does the same on a doGet, as a doPost call...

It isn't going to be as simple a matter as you say, what about servlet properties passed in from web.xml (if there are any)?

I'd agree with rrz that this could be a tricky task (depending on the servlet)
0
 
LVL 3

Expert Comment

by:kumvjuec
ID: 11869253
If someone makes use of the servlet properties, it better be left as servlet. I am only making assumtions which make sense if someone wants to convert servlet into jsp's for some very specific convenience and this is gonna be easy task for that.
If it is to be developed into a full fledged tool, i too agree lots of things will have to be taken into account.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
memory representation of int[][][] a=new int[2][][]; 10 60
How to find missing packages when using Netbeans IDE 8.1 ? 19 84
maven j2ee examles 2 64
JVM error from eclipse 1 26
A hard and fast method for reducing Active Directory Administrators members.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question