problem with form or servlet?

hello..

i am trying to send some form data to a servlet for processing..

here is the code for the form

<table border="0">

<form action="details.upd" method="post" name="upd">

<tr><td>Username</td><td><input name="uname" type="text" size="25" maxlength="30"

value=<%=session.getAttribute("user") %> /></td>

</tr>

<tr>

<td>password</td><td><input name="pass" type="password" size="25" maxlength="30" />

</td></tr>

<tr><td>confirm password</td><td><input name="pass2" size="25" maxlength="30" type="password"/></td></tr>

<tr><td>Email</td><td><input name="mail" type="text" size="25" maxlength="30"

value=<%=session.getAttribute("EMAIL") %> /></td></tr>

<tr><td align="center"><input name="submit" type="button" value="Update" /></td></tr>

<tr><td align="center"><input name="ch" type="hidden" value="det"/></td></tr>

</form>

</table>

here is the web.xml entry for my compiled servlet

<servlet>

<servlet-name>update</servlet-name>

<description>

Servlet used for updates sent from landlord sessions

</description>

<servlet-class>UpdateServlet</servlet-class>

<load-on-startup>5</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>update</servlet-name>

<url-pattern>*.upd</url-pattern>

</servlet-mapping>

the problem is that when i click the submit button to send the data, nothing happens....absolutely nothing. the page just stays as it is...please can u spot any fatal error in the code?

I have looked and looked without success..please help

[2031 byte] By [ketsona] at [2007-10-3 0:03:14]
# 1
Hi in ur html file ... 4th line from end .. is like this <tr><td align="center"><input name="submit" type="button" value="Update" /></td></tr>instead of type="button" write type="submit" i think it will work ...reply
sushruta at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanks man.....its working now..
ketsona at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

why does this..

Integer id=(Integer)session.getAttribute("ID");

gives me a null pointer exception when data is sent to the servlet?

java.lang.NullPointerException

UpdateServlet.doPost(UpdateServlet.java:77)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

thanks

ketsona at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Because your session doesn't have an attribute named "ID" in it.
stevejlukea at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
yeah..i solved that.. but now i am getting another problem...why does this code... String user=(String)session.getAttribute("user");gives me a class cast exception?please help
ketsona at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
try removing the Description tag and the space between to tag and see if it works
Ankoor_Mehtaa at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

> yeah..i solved that.. but now i am getting another

> problem...

>

> why does this code...

>String user=(String)session.getAttribute("user");

> gives me a class cast exception?

>

> please help

Because the object named "user" in your session isn't a String.

stevejlukea at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

> > yeah..i solved that.. but now i am getting another

> > problem...

> >

> > why does this code...

> >String

> user=(String)session.getAttribute("user");

> > gives me a class cast exception?

> >

> > please help

>

> Because the object named "user" in your session isn't

> a String.

ok...thks

ketsona at 2007-7-14 16:51:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...