Forum Moderators: phranque

Message Too Old, No Replies

I use ASP - Thinking About JSP.... & others

Soon to start Java at Uni - thinking using JSP instead of ASP at work

         

shoves

9:50 am on Oct 17, 2002 (gmt 0)

10+ Year Member



Hi

Sorry! Its a bit of long one:

I currently use plenty of HTML & SQL & ASP for my work intranet. (in my degree I did basic webdesign/C++/Perl) I'm thinking about starting to code my next dynamic page with JSP probably via Dreamweaver MX. Some of the things I've been thinking about:

- My final module in Feb 2003 for my masters university degree will be Java & I thought maybe familiarising myself with JSP would help considerably.

- The co I work for is using more Linux & we may well switch to Apache soon. If I wrote my future intranet & apps in JSP I could just transfer them unlike ASP? (or it'd be easier to)

- Tomcat would enable me to continue the current site with IIS & ASP but also allow JSP

- Some of my colleagues use dialup modems or mobile phones to connect to the work network & have complained about speed issues. I've heard JSP is quicker than ASP & places less of a strain on the server as ASP holds open a session for ages & is continuously reading from the server.

(current server is a Win 2k, P3,lots of ram & large drive but as well as hosting the intranet has a web app on it that uses cut down version of MSDE SQL server that retrieves data from a huge Oracle database on a unix server & posts data into access. This is used by anywhere up to 80 people to query & insert data from 4 different office sites)

- Other people have mentioned PHP,Perl-CGI,ColdFusion

* Co don't want to use cold fusion, I've heard PHP i sgreat but procedural & lastly of course it'd be alot easier to continue with ASP...

Any thoughts or advice would be greatly appreciated.

Thanks

Graham

Dreamquick

10:29 am on Oct 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some of my colleagues use dialup modems or mobile phones to connect to the work network & have complained about speed issues. I've heard JSP is quicker than ASP & places less of a strain on the server as ASP holds open a session for ages & is continuously reading from the server.

Session timeout period is controllable via code, and as for the dialup user delays the only real speed issues will be;

1) Badly coded scripts or badly designed pages.
2) Slow-running components (modules, add-ins, databases etc)
3) Large pages

None of which will really be solved by changing languages.

ASP doesn't read from the server any more than any other language, but as always it depends on what you are doing - if they pages don't change then IIS will attempt to re-use a cached copy, equally Windows disk cache will reduce the amount of reads required if the pages request a resource which hasn't changed.

From the sound of it your problems could be caused by the database - if it were me I'd talk directly to the Oracle db using ADO, having every database operation have to go through various conversions will slow it down.

If it were me I'd stick with ASP if possible, however if that wasn't an option I'd opt for PHP because I put that a small step above ASP/JSP.

- Tony

shoves

10:46 am on Oct 17, 2002 (gmt 0)

10+ Year Member



Thanks for the reply Dreamquik!

What are your thoughts on JSP helping me with my not too distanet future Java course... or doesn't really warrant my switch?

Also its likely that we'll have a Linux Apache server soon so JSP would be more portable.. though PHP would be too

Whats ADO - is it similar to ODBC?

Cheers!

Dreamquick

11:05 am on Oct 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ADO is Microsoft's data-access solution (ActiveX Data Objects is what it stands for i think) and it can connect & manipulate a variety of data-sources including Access, SQL Server and Oracle.

You can use it in conjunction with ODBC DSN connections if you want to, although it's more commonly used in what's called DSN-less connections which are more code friendly as the entire connection is defined in the code rather than just having the code point to a DSN which cannot be edited as easily.

If you want to look to the way forward then you have a couple of options - JSP might be portable but not my area of expertise I'm afraid. I'm not sure how close JSP is to JAVA, but also I'm not sure if the technologies/interfaces cover common ground due to the nature of JSP (being server-side) and JAVA (being a more traditional language which can be used on both server-side and client-side).

Have you considered getting hold of Win32 Apache and running PHP from that? That way you should end up with at least the same level of portability as you would with JSP when you move to Linux Apache.

Also I'd consider the possibilites that knowing both PHP and ASP present since the majority of sites seem to run one or the other. If they run JSP you could chime in with the I-know-JAVA-and-can-crosstrain-quickly card which is always a plus.

- Tony

ppg

1:16 pm on Oct 17, 2002 (gmt 0)

10+ Year Member



Hi Shoves,

I agree with the points Dreamquick has made - being primarily a java programmer I can give you my 2p worth on that side:

familiarising myself with JSP would help considerably

Undoubtedly it will, if you go about it the right way. The main strength of JSP is that it allows you to use an object oriented approach to designing web applications (so does ASP of course if you use COM components - .NET too though I've no experience with it). You *can* just embed pure java code straight into your web pages, but its an untidy approach and ill advised. The better approach is to spin off all your processing tasks (connecting to a database, filling a shopping cart etc) into compiled java components (javabeans) which you then call from your web pages. If you havn't done a lot of object oriented programming before, then this will introduce you to the concept, which is absolutely central to java programming. This is where you'll get the most benefit when you come to your college course. At my college when we did java and C++, quite a number of students who were very strong in the beginning stages fell by the wayside somewhat when we moved on to OO design techniques. Its imperative that you get this down if you want to get anywhere with java. I'm guessing since you've done C++ you know all about OO though. If thats the case then you'll steam along with java, you'll just have to pick up the new syntax, which is very C++-like. A lot of the work in learning java once you've got OO is farmiliarising yourself with the (huge) library of classes you can use in your apps and learning when to use which one.

I would strongly advise you to fire up a text editor and create and compile your own components for your JSP pages, don't rely on an IDE to embed other peoples' components for you. You'll learn much more this way. I still do all my web app building with a text editor and command line compiling. You'll also feel much more confident with it when you know whats going on 'under the hood' so to speak. If you want to switch to an IDE later then you'll pick it up in no time.

JSP I could just transfer them

yes you could. I develop on a windows machine with tomcat/MySQL and then install on a linux/apache/tomcat/MySQL production server. As long as you don't make system specific calls in your code there's no problem

Tomcat would enable me to continue the current site with IIS & ASP but also allow JSP

I've never tried running ASP and JSP concurrently on the same machine, not sure if its possible. I'm 99% sure that you can't pass data (like session variables say) between the two, so you couldn't build a web app out of a mixture of both.

Also, if the tomcat mailing list is anything to go by, getting tomcat to run on windows properly as a service can be a bit of a nightmare. Its pretty easy to set up on linux/apache although the documentation isn't that great. The tomcat mailing list will be your friend here.

I've heard JSP is quicker than ASP

In theory the architecture of JSP should be quicker (ASP old style is interpreted for every request of the page - I think ASP+ pages are compiled in .NET). In my experience having built almost the same web app in both technologies, there's very little to choose between them speed-wise. Perhaps if you're talking about large enterprise projects with a heavy load you might notice a difference. I've only worked on smallish web apps. Other considerations will have a much more obvious effect for your end users - spec of the webserver, available bandwidth, number of concurrent users, code optimisation etc.

A couple more things maybe worth mentioning -

where do want to be when you finish your masters?
Java is generally used for large enterprise projects. Most of the jobs I see advertised in my area are for working in the financial industry in London (city). I know that wouldn't suit me.
Small to medium companies will more likely be using ASP or PHP I expect.

For running your own projects you'll find a lot more hosts offering ASP or PHP support than you will supporting java. You will find hosts that support java, but you'll have less to choose from.

I hope this helps you. Of course its all MHO and I'm not your typical java web programmer. I work on a small site and I use java/JSP mainly because I know it better than anything else :-)

Feel free to sticky me if you like should you have any java related questions, I'll do my best.

txbakers

3:28 pm on Oct 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm 99% sure that you can't pass data (like session variables say) between the two, so you couldn't build a web app out of a mixture of both.

I'm 100% sure you can't combine the two. I had a situation where I was hoping to combine and it wouldn't work at all.

ASP runs on IIS and the JSP ran on TOMCAT. On the same machine they needed to be differentiated by port, so anything routed into the JSP port was treated as Tomcat and couldn't compile the ASP.

You can do remarkable things in both, but I wouldn't mix the technologies. There's no reason to.

dingman

4:32 pm on Oct 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've heard PHP i sgreat but procedural

I recently converted a several thousand line PHP app from procedural to OO without switching languages. I'm not absolutely certain, but I think I made it shorter in the process. I certainly made it easier to read. I'll benchmark the two against eachother soon. Objects and classes don't give me the same 'grafted-on' feel that they do in Perl.

The two things that bother me in principle about OO in PHP are that (1) constructors aren't inherited (well, they are, but as plain old methods, not constructors) and (2) apparently inherited methods are notably slower to call than ones defined in the sub class.

If you already know Java, or are going to have to learn it soon, though, I'd go with that. I'm a PHP addict 'cause it's what I learned first for the problem space, and it does the job well enough that I haven't felt compelled to learn something else for the same niche.

aspdaddy

5:39 pm on Oct 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IMO JSP and compiled Java is a good choice if the DB is Oracale, for SQL apps I'd stick with asp script or .NET.

I agree with ppg about size, finance companies generally dislike asp/sql, but knowing these two can get you plenty of contracts with SME's.

shoves

2:14 pm on Oct 18, 2002 (gmt 0)

10+ Year Member



The main database here is Oracle so by the sounds of it JSP would be good though only if run off Apache & not off IIS via Tomcat. We've got SQL server running too so plenty of ASP does get done.

THANKS LOADS FOR EVERYONES ADVICE - IT WAS GREAT!

Think I'll continue with ASP for some basic intranet & minor web apps but also set up Apache & do a JSP project.

: )

Cheers

Graham