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.

Hi,

Have you sorted out your problem? I have a similar problem and it is for my college project. Please let me know if you have managed.

My email is brcvogt@yahoo.com

src/java/Bradshaw/servlet/LoginServlet.java

And the action property in my form tag is as follows:

<form name="Input" action="http://localhost:8084/servlet/Bradshaw.LoginServlet" method="post">

I do not know hot ot do this correctly.

Regards,
Brendan

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.

given your web.xml mapping you should use /servlet/LoginServlet for the relative URL, nothing more.

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

Are you under windows vista and using internet explorer? try changing "localhost" to "127.0.0.1"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.