IntelliJ Java IDE
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes info attribute of page directive Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "info attribute of page directive" Watch "info attribute of page directive" New topic
Author

info attribute of page directive

Manjunath Subramanian
Ranch Hand

Joined: Jul 18, 2001
Posts: 236
Hi All,
I wrote a simple code to check the page attributes of a jsp.The code looks like this..(I am showing just the info attribute here for clarity)
<%@ page info="A Simple jsp testing the directives"
%>
<%
out.println("<h1>"+str+"</h1>");
%>
<%!
String str = "Testing the page Directives";
%>
<%
out.println(getServletInfo());
%>
****************************************
It gives me the output saying..
"Testing the page directives"
"A Simple jsp testing the directives ".
But when i try the xml equivalent syntax like this
<jsp irective.page info="A Simple jsp testing the directives"></jsp irective> ..instead of the second line it gives the output as
"Jasper JSP 1.1 Engine"
Now,is this because we have used the xml syntax,the info attribute cannot be converted into
getServletInfo() or is there any other reason?
And I am using Tomcat4.0.1 on win2k,why is it saying that it is using the JSP 1.1 Engine..?

Thanks in advance,
Manjunath
[ January 31, 2002: Message edited by: Manjunath Subramanian ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16617

This is probably totally of base, as I know very little.
But isn't it required that if you use the XML tags in the jsp page all the jsp has to use the XML versions, and you can't mix them.
Like
<jsp irective.page info="My Info"/>
<jsp eclaration String s = "My string to display"/>
<jsp:expression out.println("<h1>" + s + "</h1> ;/>
<jsp:expression page.getServletInfo();/>

That is a complete guess, and I hope someone can fix the bugs in my above code for me, I am trying to do that from memory, and it is the first thing I have ever written with XML jsp tags.
Thanks
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
1. If you have used everything in XML syntax then you shouldn't see any problems with the info attribute.
2. You are also required to put everything in the <jsp:root> tag.
3. Mark, is right. You can't mix the asp style syntax and the xml style syntax in the same page. Theoritically speaking, this should result in a translation time exceptions, I think (don't quote me on this, I have to verify).
Here's an example of what you are trying to acheive:


The output will be:

Pl. use either the [ code ] tags or disable the smilies (use the check box in the bottom) in your posts.
regds.
- satya
ps:
Apparently, using the code tags doesn't help. So you have to disable the smiles.
[ January 31, 2002: Message edited by: Madhav Lakkapragada ]

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Manjunath Subramanian
Ranch Hand

Joined: Jul 18, 2001
Posts: 236
Thanks a ton Satya and Mark..
This is new to me..I guess i have to work on this a lot more.
 
 
subject: info attribute of page directive
 
Threads others viewed
JBuilder 6 and custom tag-libraries
Two questions on " JSP SYNTAX 1.2 " issued by SUN
String[] as attribute to custom tag
Please Help!!!!!
JSPs as XML documents, but no HTML rendered!
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture