• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

server problem or my coding is wrong... plz help...

i am using linux redhat and installed tomcat.

i tried to test my server, thus i wrote a little simple jsp

<%@ page language = "java" import = "java.util.*, java.lang.*"%>

however, it does not work...
u can see the result at

however, when i input a wrong url, tomcat logo actually shows up

thus, i am not sure if my code is wrong or i did not install the tomcat, right??

Please Help
1 Solution
what is it u see?
your folder must be contain a folder called web-inf and then be deployed in tomcat..did you do that?
bionicblakeyAuthor Commented:
i move the jsp into web-inf, but it still did not work...

it just print out my jsp code...

Try to split the following line:

<%@ page language = "java" import = "java.util.*, java.lang.*"%>

<%@page language = "java"%>
<%@import = "java.util.*, java.lang.*"%>

and try .. and also .. the JSP file needs to be outside the WEB-INF dir ... i.e. at the same level as that of WEB-INF or in a directory structure .. that is at the same level as that of WEB-INF

there is no need to split this line.
<%@ page language = "java" import = "java.util.*, java.lang.*"%>

your  jsp page must not be in the web-inf folder
it must be at the same level
if you have class files that you wish to import or have some jar files that you want to include in your project then you place those files in the web-inf folder
it's like this, I'll try to draw you a directory sturcture of what I mean..

--jsp Files
           --your .class java files that you wish to import (note these must be in package as of tomcat 5.x)
           --your .jar files that you wish to include into your project
           --your custom tags that you want to have in your project

I hope that's clear,
if you don't understand what I mean let me know
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now