This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Surprising Problem in simple code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Surprising Problem in simple code" Watch "Surprising Problem in simple code" New topic
Author

Surprising Problem in simple code

Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126

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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60802
    
  65


/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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126

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
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
LOL

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

Look closely.


comp.lang.javascript FAQ: http://jibbering.com/faq/
danny liu
Ranch Hand

Joined: Jan 22, 2004
Posts: 185
It is good to test your jsp files separately and then test them together.
lali virdi
Greenhorn

Joined: Feb 09, 2004
Posts: 19
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60802
    
  65

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
 
jQuery in Action, 2nd edition
 
subject: Surprising Problem in simple code
 
Similar Threads
Problem Using Bean in JSP
custom taglib problem
Page Directive errorPage and isErrorPage
can any body solved my problem on RequestDispatcher.
how JaMon is helpful for web application?