Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Form bean not taking the value when property is disabled in jsp

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

MY jsp code is


<%
//Calling the class processDAO and the ICode value
processDAO dao=new processDAO();
String ICode=dao.newsupplier();

%>

and then i write

<html:text styleClass="txfield" property="code" value="<%= ICode %>" disabled="true"/>

My form bean is

public String code;
public String getCode() {
return code;
}

public void setCode(String code) {
this.code = code;
}

but its not taking the value;

But i write it as a disbled="false" in jsp it takes a value

Help me,

Thanks in advance
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
In your struts-config.xml file check the

<form-beans>
<form-bean name="LoginForm" type="com.solversa.loginForm"/>
</form-beans>


and

<action path="/main"
type="com.solversa.EmpAction"
name="LoginForm">
<forward name="success" path="/showEmployee.jsp" />
<forward name="failed" path="/error.jsp" />
</action>

In that both bold one names must be same,, but,,,
name of your form bean that i shown as bold & italic must be different than only bold one,,,
becoz faced same err .. this is solution for this.
hope this will help u...
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disabled values are not passed as parameters in the request.

<html:text styleClass="txfield" property="code" value="<%= ICode %>" disabled="true"/>



Change this to:



By changing it to readOnly, the values will be passed and also the user will not be able to change the contents(which you were trying to achieve by having disabled="true")
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic