wood burning stoves 2.0*
The moose likes JSP and the fly likes _JSP.Java to .JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "_JSP.Java to .JSP" Watch "_JSP.Java to .JSP" New topic
Author

_JSP.Java to .JSP

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hello all,

We had a developer leave our company and now I am having to pickup the pieces. Looks like I am missing some JSP files, however I do have the _JSP.Java files in my classes folder for those JSP files. does anyone know of a tool that would take the pre-compiled _JSP.Java files and create JSP files?

ANy help is much appreciated... Also i would like to know in general , How to create Java File from .class file ?

Thanks
Yogendra.


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Eeeek! I feel for you! There is no tool that I know of that would decompile a JSP Java class back to its JSP source, and, I imagine if there were, it wouldn't be able to do a very good job of it since so much info will have not been preserved. Java decompilers are another matter and you will find info on them in the general Java forums.

Were it me, I'd look at the page in action, use the generated java code as a guideline, and reverse engineer the page by hand.
[ April 06, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
No Probs dude.. Now that's what i am gonna try to do.. I've got no other choice seems so...

Thx for your reply,
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

How complicated were the original JSPs? If there was a lot of stuff in them, including custom tags, the code is likely to be a mess. If they were small or fairly straight-forward pages, it might not be so bad.

Feel free to drop in with more questions if you run into trouble. We might be able to help you decipher some of problem areas (though no promises, of course).

Is there no way to track down the ex-developer and torture him until he coughs up the original JSPs?
[ April 06, 2006: Message edited by: Bear Bibeault ]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Also stating the completely obvious, take a look at the html source generated by the jsp/servlet. That could potentially also help with reverse engineering the page. It depends what proportion of the page was dynamic, how much it included java scriptlet code etc etc...

Just out of interest, what server are you guys using? One of the issues with "untranslating" JSPs is that every server generates the java code differently, using their own support classes. It would be impossible to write a generic one.
[ April 06, 2006: Message edited by: Stefan Evans ]
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hey Guys , Thx for your replies.. I have managed to make those .java files to its equivalent jsp's by referring each line of it.. That was the killing day !!! I wonder how easy JSP is after that day ! However , Now i have a small question. We use Tomcat 5.0.16 as our server and i would like to know is there any way we can use Snchroniuzation Token in Jsp's .. I have heard that it is being used in Struts. But i want to know can the same be used in JSP and if it can be , i would appreciate if someone can post a snippet for it so that i can atleast get an idea of it..

Thx. This forum is great !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: _JSP.Java to .JSP