Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting ASP web site to Java.

Status
Not open for further replies.

Steely3000

Programmer
Jul 27, 2001
4
US
Our company has a website written in ASP (with VBScript and JavaScript embedded). I was told we need to convert the site to Java within the next year or so. So I need to learn Java to convert this site. I do know some JavaScript that I did on the ASP pages, but that's it.

So I am a newbie at this and really don’t know where to start. Some of the other sites the company uses are using servlets, so maybe I should use the same. Then there is JSP, which might be easer to learn but not sure if the company would go for it.

So what should I concentrate on learning to convert the ASP pages? Also, when I make site modifications I use IIS (Personal Web Server), but it doesn’t work with servlets when I’ve tried it. So is there a free way for me to locally test my Java website changes? Thanks for any help here.
 
JavaScript and Java are two ENTIRELY different things.

I would suggest you search the web for a Java tutorial, or take a course on it.

Why do you need to switch to pure Java anyways? I find that as far as loading times go, Java is kind of slow. I find ASP works just fine for most things...another option MAY be to switch to ASP.NET or PHP....

ComputerCop911
ASP/HTML Programmer
 
>> So I am a newbie at this and really don’t know where to start.
>> So what should I concentrate on learning to convert the ASP pages?

Well first you need to learn Java. That's for sure. I have some experience seeing others try to go right into JSP without learning Java first. It was not a pretty sight [lol]

Once you have a grasp of Java, a decent one not just a "Hello World" application. Then i recommend you learn both Servlets and JSP. That way you can decide which is best for your project, and in fact, you may use both.

Also if your server code need to do any SQL database access you will need to learn JDBC. This is simpler done from a Java application rather than starting out in a web server environment.

To do all this learning there are great tutorials and many of them at java.sun.com for all these subjects and many, many more.

>> So is there a free way for me to locally test my Java website changes?

Sure, the Tomcat Web Server is freely available at apache.org. Once again for Tomcat there is tons of documentation.

[soapbox]
One of the most common problems I see with people starting down a new programming path is they expect things to be simple. They therefore don’t read any documentation or tutorials and they think they can just start writing code for their project. This creates a problem for them that is extremely complex since it is the sum of all the parts, none of which they understand. Be patient, learn each subject separate from the others (simplify / divide and conquer )
[cheers]



-pete
 
I know I said this already, but why do you need to convert the ASP pages anyways?

ComputerCop911
ASP/HTML Programmer
 
To convert ASP your best bet is to use JSP and JavaBeans to take the place of ASP and ActiveX controls.
Servlets can take the place of ASP pages that do not generate output.

For a first project a one on one port would most likely be best, especially if you have no prior experience with Java technologies (so you will be learning as you go along).

Get a GOOD JSP book (O'Reilly has an excellent one) and study that.
If you don't know Java yet, study Java too (skip the GUI stuff, you won't need it).

My first JSP project started out as a port of an ASP application too, but along the way we decided to rebuild from scratch using only the datamodel and design documents of the original.
This (for us) turned out to be faster, but then we had more Java experience than ASP (so for us the ASP code was more documentation of the business logic than a template to use).
 
Thanks for all your great suggestions and help...

It is the company's decision to convert EVERYTHING to Java within the next 2 years. One reason is because many of the apps we have are already Java apps, so they want everything consistent, and also for security reasons. Anyway, it wasn't my idea.

Also, I was told Friday that I would need to use Servlets (not JSP) and probably XML as a front end. Wish me luck!
 
did they specifically state that you can NOT use JSP?
There's always a loophole, and if not you can still use Servlets with XML/XSLT or some other form of output templating.

Take a look at Jakarta Tapestry for some ideas.
(I've written something similar using XML messages and XSLT output templates myself last year in a few weeks that was quite flexible. Would do it differently today of course, but the existing code is good).
 
>> Also, I was told Friday that I would need to use Servlets (not JSP)
[soapbox]
Well that is an interesting constraint given that JSP pages ARE Servlets. So either that individual is not aware of that fact or there is some other logic (or not, maybe misinformation) behind that decision. I would certainly not believe that is an acceptable constraint without proof... but that’s just me [wink]

Secondly, there is no reason to apologize for migrating from ASP to JSP/Servlets. It is a perfectly reasonable thing to do for many reasons.





-pete
 
I think servelet work similar to cgi(like perl).
I read from a book that tells very jsp page needed to converted to servlet on server, compiled thing can be run.
Jsp is used for display and the servlet is for more backend processing. But you can use servlet to display or output to a file or update database.
 
<soapbox>
prosper,

Please try not to give incorrect info out ...
>>>> I think servelet work similar to cgi(like perl).

This can not be further from the truth - CGI is interpreted and executed on the server for each request, whereas Servlets are precompiled, and generally one instance servers each request. So, they are two completely different approaches to servicing HTTP calls dynamically.
</soapbox>
 
you forget another far more important difference:
CGI spawn a new process for each request, Servlets are true multithreaded and will spawn a new thread inside a single process (note that on some operating systems the JVM is implemented to spawn a new process for each thread but this is an implementation specification of the JVM rather than the servlet implementation).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top