?
Solved

convert servlet to jsp

Posted on 2004-08-22
8
Medium Priority
?
450 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 28

Accepted Solution

by:
rrz earned 336 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 28

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Assisted Solution

by:kumvjuec
kumvjuec earned 332 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 332 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

Industry Leaders: 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!

Question has a verified solution.

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

The well known Cerber ransomware continues to spread this summer through spear phishing email campaigns targeting enterprises. Learn how it easily bypasses traditional defenses - and what you can do to protect your data.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

771 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