• 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

struts html tag question

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<INPUT type=radio CHECKED value=radiobutton name=radiobutton1>
I want to convert the above using html struts tags? How to include the checked in below?

<html:radio property="nobackbill"/>
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
html:radio
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so is it correct if i say:
<html:radio value="on" property="getBill"/>

to get a checked radio button.
And where I don't need it checked, I will put the value="off"

Am i right?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Liz,
You are correct. Note that as written, the field in your form is "getBill". So you would have a getter called "getGetBill." I suspect, you want the radio button to be "bill" which maps to a getter called "getBill."
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.
i am facing another html tag problem.

I give text field as:
<html:text name="textfield" property="startDate"/>

I have given get and set method in the form.however, i can't see anything.

I get with plain html :
<INPUT size=50 name=textfield>

what may be wrong?
 
Ranch Hand
Posts: 156
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
put just
<html:text property="startDate"/>
check whether u have given correct getmethod getStartDate()
and setStartDate()
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have given it correctly but still same problem
 
santhoshkumar samala
Ranch Hand
Posts: 156
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
go through following steps
1)check whether you have declared html taglib in your jsp i.e,
<%@ taglib uri="ur tag lib location" prefix="html" %>
2)check whether ur giving correct form name in struts-config.xml
3)check whether the action in jsp
<html:form action=""> is referring to correct path in struts config.

If everything is correct and still u face problem, please post ur jsp and struts-config and actionform
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does the formname here has to be the formbean name object or any name here for the form?
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks! got it .i was not using the <html:form>

How to get a checked checkbox?
<html:checkbox property="imported">

gives only a checkbox, but if i had to show user default which is checked, how to?
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic