0

In my application,with the help of joining,I am showing the dynamic value in my jsp page like this :

<%  while(rs.next()){ %>
<td><input type="checkbox" name="chkName" onclick="selectall()"></td> 
<td><input type="text"  name="empId" value="<%= rs.getString(1)%> "   disabled="disabled"  maxlength="10"></td>
<td><input type="text" name="device" value="<%= rs.getString(2)%>"   disabled="disabled" maxlength="10"></td>
<td><input type="text"  name="features" value="<%= rs.getString(3)%>"  disabled="disabled" maxlength="60"></td>
<td><input type="password" name="password" disabled="disabled"></td>
<td><input type="text"  name="policyName" value="<%= rs.getString(4)%>"  disabled="disabled" maxlength="10"></td>
</tr>
<% } 
%>

And whenever from another servlet(as I want to show the fetching from this jsp to another jsp ) I am calling request.getParameter("empId"),it is fetching the "NULL" value.I think,I have to use set(session.setAttribute() or request.setParameter()).

Any suggestion will be appreciated.

Tirtha
  • 351
  • 2
  • 6
  • 22

4 Answers4

2

Might be because of the disabled attribute .. maybe you can replace it with readonly instead?

kukudas
  • 4,834
  • 5
  • 44
  • 65
  • can you show some code? it should look like this: . If you remove the disabled attribute you will not get NULL right? – kukudas May 17 '12 at 20:49
1

Do you mean to say you need to pass values between 2 jsp pages? Then you could use it by setting it in a hidden input field or set it in session...

check if this helps you... Using request.setAttribute in a JSP page

Community
  • 1
  • 1
ria
  • 7,904
  • 11
  • 39
  • 46
0

Another simple way.

You can add a hidden type .

<td><input type="text" value="<%= rs.getString(1)%> "   disabled="disabled"  maxlength="10"></td>
<td><input type="hidden"  name="empId" value="<%= rs.getString(1)%> "  maxlength="10"></td>
saneryee
  • 3,239
  • 31
  • 22
-2

try request.getParameter("empID") for the field named empId not <i>empId. Hope that helped , just rename the field in the form

seeker
  • 6,841
  • 24
  • 64
  • 100