I am unable to pass run time value in "propety" and "type" attribute of
<bean:define> tag
-----------------------------------------------------------------------------------------
Key: STR-3057
URL: https://issues.apache.org/struts/browse/STR-3057
Project: Struts 1
Issue Type: Bug
Components: Taglibs
Affects Versions: 1.0.1
Environment: struts 1.0, jsp 2.0, jdk1.5
Reporter: kamlesh sharma
I need to define a varible type of that varible should be define at run time.
i am geeting one parameter from request whcih define type of varible and
property name of that bean where it should be created.
String temp="";
String prop = "";
String typ = "";
if(null !=request.getAttribute("flag")){
temp = request.getAttribute("flag");
}
if(temp.equals("true")){
prop = "currentUser";
typ = "com.for.model.vo.UserVO";
} else{
prop = "currentContact";
typ = "com.for.model.vo.ContactVO";
}
<bean:define id="vo" name='"myBean" property="<%=prop%>" type="<%=typ%>" />
it does not work but when i pass hard code value in these attribute then..it
works fine.
i.e.
<bean:define id="vo" name='"myBean" property="currentUser"
type="com.for.model.vo.UserVO" />
OR
<bean:define id="vo" name='"myBean" property="currentContact"
type="com.for.model.vo.ContactVO" />
Please tell me, does it possible to pass run time value in this tag and if we
can then where i am doing mistake in above code.
please revert back as soon as possible.
kamlesh sharma
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.