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 ]
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
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 ]