Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Script for testing

 
rahul karwal
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone pls tell me why is Java Script preffered for validation of JSP's?
Thanking you
aziz d
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35757
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!