• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

info attribute of page directive

 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton Satya and Mark..
This is new to me..I guess i have to work on this a lot more.
 
I am displeased. You are no longer allowed to read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic