• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Surprising Problem in simple code

 
Ranch Hand
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello frns,
I have a servlet ViewServlet.java where I take a request dispatcher object and try to forward the request to another page hello.jsp that has absolutely nothing except a hello message. Even though I am getting a strange error like the following in Jboss app server. I have not configured jsps in web.xml file as they can be used still.
"20:33:50,029 ERROR [Engine] ApplicationDispatcher[/multirecordview] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /hello.jsp(0,36) equal symbol expected
"
after a few stack trace it gives
"at component.ViewServlet.doPost(ViewServlet.java:64)"
and my line no 64 is a System.out.println() just after forward. When I print the exception I get..
"org.apache.jasper.JasperException: /hello.jsp(0,36) equal symbol expected"
ViewServlet.java
================
62 : RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher("/hello.jsp");
63 : requestDispatcher.forward(request, response);
hello.jsp
=========
<%@ page language="java" contentType"text/html" %>
<html>
hello
</html
I hope I have made the things clear. Can anyone put some light on this ..
Waiting for replies,

nitin
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


/hello.jsp(0,36) equal symbol expected
<%@ page language="java" contentType"text/html" %>


Not to be a jerk, but did you even try to figure this one out? I mean, it even gave the character position where it expects an equals sign.
 
Nitin Dubey
Ranch Hand
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes I did bang my head for the problem. but since I got the error for the first time I was confused. anyways I got the problem. what was just a simple typing mistake that ate some of our valuable time..
nitin
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
LOL


<%@ page language="java" contentType"text/html" %>


Look closely.
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is good to test your jsp files separately and then test them together.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi the problem is in the first line
<%@ page language="java" contentType"text/html" %>
<%@ page language="java" contentType = "text/html" %>
the = sign is missing ;
i hope it will definately help you
ok by
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch "lali lali"!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JSP Forum Bartender
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic