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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing asp via jsp

Status
Not open for further replies.

tester321

Programmer
Mar 13, 2007
150
CA
Hi i was wondering if there are any benefits and what they might be to write asp using jsp? Thanks
 
vbscript works only on IE...use javascript to support all browsers...thats one benefit...

-DNG
 
I have to admit I don't understand the question or the relevance of the response to the question.

JSP is Java Server Pages. It is written in Java (as in the language from SUN, not to be confused with Javascript) and runs on Tomcat on either Apache or IIS (possibly others). It compiles to Java Servlets and, at least back when I used it, gives back horrendously useless error messages.

ASP is Active Server Pages. ASP is basically a collection of objects that provide an interface between a script and HTTP data from IIS. ASP is not a language and can in fact ASP pages can be written in a variety of languages.


Now, if your question was whether there are any benefits to writing ASP pages using Javascript, that then makes some sense (though sadly, still does not make the first response relevant).
VBScript has a very limited syntax and does not offer all of the capabilities of Javascript natively. Error handling in VBScript is barely better than useless.
One advantage you have (that I can begin to see the relation to the first response on) is that if you use Javascript for a client-side language, using VBScript makes your server-side code stand out more. However this argument normally makes me cringe because if a programmer has that much difficulty knowing the difference between their client-side and server-side coder then I would prefer them to be doing neither.

Javascript has been shown to be faster in some instances, but I don't use it regularly and haven't benchmarked it recently against VBScript, so I don't have any info on that.

Other options I have tried include Python and Perl. Somewhere in the depths of the forum is a set of benchmarks showing some common actions in each language vs the other (concatenation vs Response.Write) but I don't remember if I did full benchmarks and posted everything or just posted the results somewhere as advice.

 
I think you mean JScript, typically the name given for ASP written in Javascript.
I personally use JScript, the main reason being that I'm way more familiar with Javascript over VBScript.

Personally, I'd stick to what you are more familiar with, if you are more comfortable with Javascript, use JScript, if not, use VBScript(default, based off default IIS settings).



[monkey][snake] <.
 
If it is a long an fairly complex piece of code, then JSP will be faster than ASP. If it is a short piece of code, then there is no advantage.

ASP script languages are normally interpreted so if it is complex, it will take longer to run. The big advantage of ASP is that all you need to install is IIS and possibly WSH5.6. The disadvantage is that it is only available on Windows. Another advantage of IIS is that a high powered machine is not required. I have run IIS on a 120MHz PI and it serves out the stuff fast enough, including database lookups.

JSP needs something like Tomcat. The big advantage is that Tomcat is available for both Unix and WIndows. You'll also need to install JDK. The big problem with JDK is that there are so many versions and they don't guarantee that anything will work with either earlier or later versions. Another problem is that you need quite a pokey machine with quite a lot of memory as the page needs to be compiled before it can be served.
 
Aiiee...


JScript: JScript is just Microsoft's word for Javascript (which was Netscapes term). They're both ECMAScript...technically.

I seriously doubt the length and complexity of the code is the speed/efficiency difference between JSP. Additionally, the statement that JSP needs lots of memory because it is compiled seems unrealistic. In general I would expect:
VBScript to be slower in general because it is interpreted at runtime, includes all files into one long file before running through interpretation (in memory) and uses variants for all variables.
JSP I would expect to be faster in most circumstances because it is compiled down to an intermediary byte code and is strongly typed. If I remember correctly JSP pages are not compiled every time a page is requested, but instead is compiled only after a change has been made (like ASP.Net) and then the compiled form is used for all later requests. This means the first request is dog slow (relatively speaking) and later requests are faster. Then again, the person getting the compile load is likely the programmer since he is likely the first person to try out a page after the code has been changed.

The fact that there are so many version of the JDK is a pain in the butt and one of the reasons I was not happy with Java the last time I was using it regularly.

 
Jscript is server side code like vbscript. where Javascript is client side. Big differnce.

I like jscript over vbscript, I prefer the try catch error trapping.
 
Thanks, but i thought I heard something about tightened security and the ability to share JSP variable with asp if you use JSP to write out your ASP, giving ease of programming without going by a defined scope.
 
There is no rule written on the stone relating "side" with "language" (or a flavour of it). The pseudo rules are drawn from habit of default deployed and packaged support. If you have a mind already set for the contrary, ignore the comment.
 
kss444 said:
Jscript is server side code like vbscript. where Javascript is client side. Big differnce.

Er..no.

myself said:
JScript: JScript is just Microsoft's word for Javascript (which was Netscapes term). They're both ECMAScript...technically.

I can't comment on the JSP/ASP variable sharing, the comment doesn't make sense. Even if you were commenting on using ASP with Javascript/JScript (and still calling it JSP) then basically you would be saying something about sharing a variable between ASP and ASP, which still doesn't make sense.

Tsuji hit the nail on the head. ASP is generally written in VBScript because it is the default for IIS. Javascript is generally the default client-side scripting language because it is/was the widest spread cross-browser scripting language.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top