Solved

convert servlet to jsp

Posted on 2004-08-22
8
442 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
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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