hi

does any1 knw how to put the path for servlets in netbeans.

it is located in src/java/controll/servlet

i have this in my code action = "servlet/controll.servlet" but it says directory not found

thanx
ps I posted it here because nobody is answering it in jsp section!! :rolleyes:

What are you trying to accomplish?
I don't have Netbeans installed here (don't like the product, too slow and cumbersome) but you should be able to add the requires jar to compile them like any other.
If you want to have Netbeans generate a web application it should automatically do that for you and set up your web.xml and server environment as well (if Netbeans supports such options, I think it does by now).

hi

it does everything automatically. I have a page where someone should enter their names, it should read the servlet to display the names or store it. But it does not read the path it says 404 error servlet not found. I think it is something to do with the path name in action, i couldnt figure it out.

that would be Bradshaw.servlet.LoginServlet which would need a mapping in your web.xml deployment descriptor as well.

Thanks for the quick reply!!

In my web.xml file I have the following:

<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>Bradshaw.servlet.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>

Is this correct?

Regards,
Brendan

Still not working, unless if something is wrong in my web.xml file? I've posted this as well. I don't usually work with java, but it's for my college project.

that would be Bradshaw.servlet.LoginServlet which would need a mapping in your web.xml deployment descriptor as well.

hi..
i m using netbeans 5.whenever i try to run any jsp/servlet /html file in netbeans,an error occurs "port 8084 is already occupied.but in 8084,apache tomcat runs.still the files does not run...

hi.. i m using netbeans 5.whenever i try to run any jsp/servlet /html file in netbeans,an error occurs "port 8084 is already occupied.but in 8084,apache tomcat runs.still the files does not run...


You may want to identify what application is running at that port.
Execute

netstat -aon | findstr “8080″

(the straight line between two commands on windows will come as two shorter lines over each other)
In my case last data in executed command stands for process ID (PID) was 3016. Next is

tasklist | findstr “3016″

this returned java.exe

If you got java as return then you have already running instance of Tomcat and you need to use Administrative Tools >> Services to shut down this instance. In case it is different application you need to configure either application to use different port of NetBeans to open Tomcat on different port

Attachments find_port.png 9.12 KB
This article has been dead for over six months. Start a new discussion instead.