• 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

JSP and XML

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to create a JSP page using XML.
Here is the code snipper :-
<%-- XMLJsp.jsp --%>
<HTML>
<HEAD><HEAD>
<BODY>
<jsp:expression>request.getParameter("name")</jsp:expression>
</BODY>
</HTML>
Now, when I try to access the JSp page using the URL http://localhost:8080/XMLJsp.jsp?name=Kunal
I get a compiler error jsp.error.badaction.
Is there something wrong with the code. I am using Tomcat 4.1.12
Regards,
Kunal Jaggi
SCJP2
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see several things wrong with the code:
  • The entire page has to be enclosed in a <jsp:root> element
  • <%-- --> is not a valid comment in XML syntax; XML comments are <!-- -->
  • The <HEAD> element is not properly terminated

  • Your code should looks something like this:

    Note that I haven't tried to run this page, but I think it does fix most of your problems.
    Mark
     
    Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic