vaishoo Dhembre

Greenhorn
+ Follow
since Apr 20, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vaishoo Dhembre

Hi

sorry guys i forgot to mention that
Error :404 in coming for case 1) form1.html itself and servlet-mapping comes later

here it is

i have
webapps----------->jsp-examples
| |
| |-------------->servlet-examples
|
|------->BeerV1


"/jsp-examples" comes with tomcat by default so no problem in executing
even if i write servlet/jsp under "/jsp-examples" and modify web.xml which is already there is fine...goes wel

same with "servlet.examples"

now i have my own

"BeerV1" which is peer to "jsp-examples" and "servlet-examples" as you can see in diagram

under which i have
1)/BeerV1/form1.html
2)/BeerV1/WEB-INF/web.xml
3)/BeerV1/WEB-INF/classes/SelectBeer.class

Error:404 for 1)/BeerV1/form1.html itself

so my guess is tomcat might not be getting resources under /BeerV1
how can we solve this any suggestion? also i will make sure servlet-mapping should not go wrong.
Any Help ???

Thanks
~vaishoo
Thanks
I will try my best

~vaishoo
case 1)--------------------------------------------

1) C:\tomcat\Tomcat 5.5\webapps\BeerV1\form1.html
<html>
<body>
<form method="GET" action = "/BeerV1/Select.do">
color:
<select name="color" size="1" >
<option>light
<option>amber
<option>brown
<option>red
</select>
<input type="SUBMIT">
</form>
</body>
</html>

2)C:\tomcat\Tomcat 5.5\webapps\BeerV1\WEB-INF\web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<servlet>
<servlet-name>SelectBeer</servlet-name>
<servlet-class>example1.SelectBeer</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SelectBeer</servlet-name>
<uri-pattern>/BeerV1/Select.do</uri-pattern>
</servlet-mapping>

</web-app>

3) C:\tomcat\Tomcat 5.5\webapps\BeerV1\WEB-INF\classes\example1\SelectBeer.class

package example1;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class SelectBeer extends HttpServlet
{
public void doGet(HttpServletRequest req , HttpServletResponse res) throws
IOException,ServletException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("hi vaishoo");

}
}

Error: 404
-------------------------------------------------------------------------------------------------

case 2)
------------------------------------------------------------------------------
Now if i try same example under jsp-examples it is working

1)C:\tomcat\Tomcat 5.5\webapps\jsp-examples\form2.html
2)C:\tomcat\Tomcat 5.5\webapps\jsp-examples\WEB-INF\web.xml
<servlet>
<servlet-name>SelectBeer</servlet-name>
<servlet-class>example1.SelectBeer</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SelectBeer</servlet-name>
<url-pattern>/servlet/SelectBeer</url-pattern>
</servlet-mapping>


3)C:\tomcat\Tomcat 5.5\webapps\jsp-examples\WEB-INF\classes\example1\SelectBeer.class

No error
-----------------------------------------------------------------------------------------------------------------

so my question is
is there anything missing in my own web.xml as i mention in case 1
or any mistake in mapping that servlet?
or any other reason?
Hi,

I wish to start learning hibernate
can anybody suggest me good reference
so that my spirit stays up.


Thanks
~vaishoo
Thanks for showing some interest

yes i wrote web.xml under WEB-INF

now i have Mypro/form.html
and Mypro/WEB-INF/classes/****.class file

mapping for servlet is also checked...

in short formally done everything which required..

but dont understand why Mypro under webapp cant work the expected way.
Hi

I need help

In tomcat they have "jsp-examples" and "servlet-examples" under webapps
I have tried one example of servlet from HFSJ and it worked as I got existed root context means under "jsp-examples".

same thing again I made my project folder under "jsp-examples" and wrote my own web.xml and just wrote <servlet> tag
and tried to do the same thing like which I tried before...this time it didn't work

so I would like to know...

if "jsp-examples" has its own WEB-INF and if I write my own "Myproject/WEB-INF" under "jsp-examples/" will it work?

or

If I want to have my root context under "webapps" what is basic thing to do first.


Thanks
~Vaishoo
Hi
Tonyo,

I have
HFSJ J2EE 1.4
August 2004: First Edition

~Vaishoo
Hi

In my HFSJ book
the correct answer is

D. The JSP containing this directive should not have any
Expression Language code evaluated by the JSP container.

I think this is correct...

~Vaishoo
Hi
Guys

I have just started reading HFSJ book
I came across many questions but this forum is helping a lot
I started with JSP
and now on <jsp:useBean>
As per HJSF book
<jsp:useBean> can also create bean!
it 1st searches for existing thing but if it doesn't find one it creates one
does it mean if you write <jsp:useBean > tag in your jsp
and without actually writing class for bean..container will create class which is specified in class attribute of tag...
I didn't get it???

can any one guide?

Thanks
~vaishooD