aspose file tools
The moose likes Testing and the fly likes finding attributes in a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Reply Bookmark "finding attributes in a jsp" Watch "finding attributes in a jsp" New topic
Author

finding attributes in a jsp

ch hemasundar
Greenhorn

Joined: Jul 01, 2008
Posts: 6
Hi all..
can any body help me ..
how to find the tags in a jsp using any testing f/w?

thanks and regards
Hemasundar
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26152
    
  66

Hemasundar,
If using JUnit, you could read in the JSP and search for a regular expression:
<\\w+

If you have XHTML compliant JSPs, you could use PMD and write rules to go against the JSP.


[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
ch hemasundar
Greenhorn

Joined: Jul 01, 2008
Posts: 6
Hi Jeanne,
I want to test a java_server_page whether it is having a page attribute or not.
In the process, i think one solution is java server page parsing.
But how to load a java_server_page in a class and parse it?
Could you please provide me an example if possible?

Thanks in advance
hemasundar
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26152
    
  66

Hemasundar,
My answer was about static analysis of a JSP. I don't know how to do dynamic analysis without actually running it. If you can write it, how about creating a test servlet that forwards to the JSP?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: finding attributes in a jsp
 
Similar Threads
query string
Standard actions in a JSP document?
OutputStream already obtained
No output in jsp
Simple "email a page" functionality?