Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
problem with the bean tag
shukla raghav
Ranch Hand
Posts: 208
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i am trying to use a bean tag in this
test
app
struts.xml
<action name="BeanTag" class="datatags.BeanTestAction"> <result>/DoBean.jsp</result> </action>
DoBeanTag.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <s:form action="BeanTag"> <s:submit value="Create Bean"/> </s:form> </body> </html>
DoBean.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <s:bean name="formtags.SelectBean"> <s:param name="id" value="2111"/> <s:param name="itm" value="Washing Machine"/> <s:property value="itm"/> </s:bean> </body> </html>
SelectBean.java
package datatags; import java.util.ArrayList; public class SelectBean{ private String id; private String itm; public void setItm(String item) { System.out.println("setItm"+item); this.itm = item; } public String getItm() { System.out.println("getItm"+itm); return itm; } public void setId(String id) { System.out.println("setId"+id); this.id = id; } public String getId() { System.out.println("getId"+id); return id; } }
BeanTestAction.java
package datatags; import com.opensymphony.xwork2.ActionSupport; public class BeanTestAction extends ActionSupport{ }
why is the bean nt working what is the problem?
shukla raghav
Ranch Hand
Posts: 208
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i have resolved the problem . my Mistake.Sorry
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
java.lang.NullPointerException
method not executing in action class
passing form parameters such us textfield values using url tag
bean tag problem
Struts 2.x : How to call method in the bean using bean tag
More...