• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

HFSJ-Mini MVC doubt

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm preparing for scwcd, I'm new to servelets/jsp's. I'm trying to do the mini mvc project given in 3rd chapter of HFSJ book. I followed exactly what is mentioned in the book. Everything working fine but, I'm not getting any response after clicking "SubmitQuery" button in the "http://localhost:8080/Beer-v1/form.html".I wrote same code in BeerSelect.java as mentioned in the book. Anything else to be done? Please clarify.

Thanks,
Sanjana.
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Do you have your Tomcat server running and able to see default page when you type in http://localhost:8080

When you say you are not getting any response is it a blank page or a Page Not Found error. Please be clear.

Thanks
Chandu
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's hard to trust that your code is identical to the book when you say you click a "SubmitQuery" button.

If absolutely nothing happens on submission, I suspect your form.html has a typo that is preventing the form from being submitted.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think problem is in deployment. Please be make usre that it is exactly as it is in the book. Sometimes if you miss the ending text for the xml in the deployment file then simply it dont display anything.

thats it.
ravinder uppala.
 
Sanjana Rao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Chandra Sagi,
I could able to open the default page http://localhost:8080.Its not a blank page or a Page Not Found error, the page remain unghanged.
Marc Peabody,
Even I'm wondering how I'm getting "SubmitQuery" button; below is the code I wrote in "form.html";
<html>
<body>
<h1 align="center">Beer Selection Page</h1>
<from method="POST"
action="SelectBeer.do">

Select beer Characteristics<p>
Color:
<select name="color" size="1">
<option>ligt
<option>Amber
<option>Brown
<option>Dark
</select>
<br><br>
<center>
<input type="SUBMIT">
</center>
</form>
</body>
</html>


Ravinder Uppala,

I .... Please be make usre that it is exactly as it is in the book. Sometimes if you miss the ending text for the xml in the deployment ....



I copied exactly from the book.What is "ending text " you mentioned, can you please explain in detail.

Thanks,
Sanjana
 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
plz make sure that your tomcat is properly running...also plz post your web.xml file.
[ March 27, 2006: Message edited by: Vinod NS ]
 
Sanjana Rao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Tomcat is working fine,I could able to open "http://localhost:8080/Beer-v1/form.html".
The following is the web.xml kept in deployment "..\Tomcat 5.0\webapps\Beer-v1\WEB-INF\" directory;
<?xml version="1.0" encoding="UTF-8"?>
<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/web-app_2_4.xsd"
version="2.4">

<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
</web-app>

Just to inform, also BeerSelect.java is same as HFSJ'S.Built that and kept in deployment directory as mentioned in HFSJ.

Thanks,
Sanjana.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanjana,

There is typo in your html file. Corerect this as follows



It should work.

Thanks
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check your log file or tocat console?
 
Sanjana Rao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
It's working now,
thanks a lot Narendra Dhande.I changed "from"->"form".
thanks Vinod and group.

Sanjana.
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic