can't seem to get my java servlet to work

p;  <servlet-class>test.HelloServlet</servlet-class>  
        </servlet>  
 
        <servlet-mapping>  
                <servlet-name>hello</servlet-name>  
                <url-pattern>/helloServlet</url-pattern>  
        </servlet-mapping>  
</web-app> 
<web-app version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/j2ee" xsi:schemalocation=
"http:/java.sun.com/dtd/web-app_2_3.dtd">
        <servlet>
                <servlet-name>hello</servlet-name>
                <servlet-class>test.HelloServlet</servlet-class>
        </servlet>

        <servlet-mapping>
                <servlet-name>hello</servlet-name>
                <url-pattern>/helloServlet</url-pattern>
        </servlet-mapping>
</web-app>

So now I access it all with this web address:
http://localhost:8080/hello/helloServlet
Unfortunately I still get the same error as before.

I found one bug from looking at the logs, but now I don't understand anything the log says. I'm not sure which major/minor version it would be talking about.
 
The error means that you have compiled the class with a later version of Java than the container is running.

You need to compile the class with the same version of Java that the container is using. Container" is short for "servlet container" -- the part of servers that's implements the servlet capabilities.

Back  [1] [2] [3] 

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright