This is from the bean:write doc:
name
Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by |property| (if specified). If |property| is not specified, the value of this bean itself will be rendered.
(REQUIRED) (RT EXPR) property
Specifies the name of the property to be accessed on the bean specified by |name|. This value may be a simple, indexed, or nested property reference expression. If not specified, the bean identified by |name| will itself be rendered. If the specified property returns null, no output will be rendered.
(RT EXPR) scope
Specifies the variable scope searched to retrieve the bean specified by |name|. If not specified, the default rules applied by |PageContext.findAttribute()| are applied.
(RT EXPR)
So, you are telling the tag to look for a request attribute called "employees" which is expected to have methods called "getUsername" and "getId" (seems like "employee" would be a more appropriate name, whereas a name like "employees" would typically signify a collection). Is this what you meant to do? Hard to tell exactly what you are trying to do without a description of the page itself.
You don't show your Action code. Are you setting this bean as a request attribute (under the key "employees") in your Action before you forward to the JSP?
Erik
Nishant wrote:
i am getting strange problem./.... Setting target to error 11/20 16:21:27 error Unhandled exception thrown from /editemployee.jsp:22 [1]javax.servlet.jsp.JspException: Cannot find bean employees in scope request at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:940) at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:286) at jrun__editemployee2ejsp11._jspService(jrun__editemployee2ejsp11.java: 115) at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43) at jrun.jsp.JSPServlet.service(JSPServlet.java:119) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.j ava:449) at jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatche r.java:418) at jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java :175) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor. java:1069) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestP rocessor.java:274) at org.apache.struts.action.RequestProcessor.processForwardConfig(Reques tProcessor.java:455) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Ti lesRequestProcessor.java:320) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
my jsp page containing. ...... <td><bean:message key="profile.username" />:</td>
<td> <bean:write name="employees" property="username" scope="request" /></td>
<td><bean:message key="profile.id" />:</td>
<td> <bean:write name="employees" property="id" scope="request"/></td>
my struts-config.xml having
<form-beans>
<form-bean name="employeeForm"
type="com.cybage.EmployeeForm" />
</form-beans>
<action path="/Edit" type="com.cybage.EditProfileAction" name="employeeForm" scope="request" validate="false"> <forward name="success" path="/EmployeeList.do"/> <forward name="error" path="/editemployee.jsp"/> </action>
i am not getting where is problem alies ... help plz
thanks in advanced ..
Regards
Nishant Patil
Software Engineer
Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company)
[EMAIL PROTECTED]
www.cybage.com
"There is difference between knowing the Path and walking on the Path"