This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes Java Script for testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Java Script for testing" Watch "Java Script for testing" New topic
Author

Java Script for testing

rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
Hi,
Can anyone pls tell me why is Java Script preffered for validation of JSP's?
Thanking you
aziz d
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
JSP just generates an HTTP response. You need to validate the response. HTTPUnit is a good unit testing framework to do just that. I'm not sure I'd go as far as saying that JavaScript is preferred, but definitely some client-side unit testing framework is necessary to validate that your JSP files are generating the correct output.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

Aziz,
Do you mean testing the jsp or testing what the user entered on the jsp? If you are testing the jsp itself, I agree that HttpUnit is good.
If you are testing user input, javascript is good because it doesn't require a server roundtrip. It gives the user immediate feedback. It is good to have server side testing too in case someone turns over javascript.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Script for testing