Solved

convert servlet to jsp

Posted on 2004-08-22
8
437 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
simple jsp servlet and webservice web example 5 110
Javascript onclick event 4 101
parse example 13 86
IE doesn't Invoke servlet in iframe 1 94
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now