This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How do i adjust the label width n make it bold ? in the jsp of Struts2 aplication ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How do i adjust the label width n make it bold ? in the jsp of Struts2 aplication ?" Watch "How do i adjust the label width n make it bold ? in the jsp of Struts2 aplication ?" New topic
Author

How do i adjust the label width n make it bold ? in the jsp of Struts2 aplication ?

Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41

Hi
I have an struts2 application with jsp pages where i have struts2 tags something like this

<s:form action="contactus.action" method="post" name="ContactUs Form" >
<s:textfield name="cust.fname" key="fname" size="25" maxlength="20" required="true" />
<s:textfield name="cust.lname" key="lname" size="25" maxlength="20" required="true"/>
</s:form>

where i get the "label" and the "input " box , I have to make the label as bold and adjust the width for the long labels ,In the text.ftl i cannot make such changes i guess ?

Here i display the label from the resource bundle .

Then how do i adjust the label width n make it bold ?
suraj savaratkar
Ranch Hand

Joined: May 17, 2010
Posts: 67
Are you using .property files then you should be do, in '.property' file.
Enclose the <font tag> over which label you want to make a bold.
mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69

I think textfield tag have a theme attribute make it normal(it may be 'simple' )
And then customised your look and feel
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Override the default CSS. This is the easiest, cleanest, most appropriate solution.
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
Hi
This is actually my form

<span style="font-weight:bold;">
<s:form action="contactus.action" method="post" name="ContactUs Form">

<s:textfield name="cust.fname" key="fname" size="25" maxlength="20" required="true"/>
<s:textfield name="cust.lname" key="lname" size="25" maxlength="20" required="true"/>
<s:textfield name="cust.title" key="title" size="25" maxlength="20" required="true"/>
<s:textfield name="cust.company" key="company" size="25" maxlength="50" required="true"/>

<s:select name="cust.state" key="state" cssStyle="font-family: verdana;font-size: 12px;width:275px;background-color: #FCFCFC;" list="{'Alabama','Alaska','Arizona','Arcansas','california','colorado','Florida','Georgia'}" headerKey=""
headerValue="<--Please Select-->" />
<s:textfield name="cust.zip" key="zip" size="25" />
<s:select name="cust.country" key="country" required="true" cssStyle="width:275px;background-color: #FCFCFC;font-family: verdana;font-size: 12px;" list="{'India','USA','UK','Germany'}" headerKey=""
headerValue="<--Please Select-->"/>
<s:textarea wrap="soft" name="cust.pd" key="pd" cssStyle="padding: 5px;" rows="5" cols="35" />

<s:checkboxlist name="cust.communityList" key="AreYouInterestedIn" cssStyle="vertical" theme="mytheme" templateDir="template"
list="{'WebSpere Consultuing','Portal Consulting','SOA/BPM Consulting',
'Content Management','DataPower Consulting','Information Management Services',
'Application Monitoring','Application Security','Migration to WebSphere','Application Testing',
'WebSphere Version Upgrade','JAM/Panther Consulting','IBM Software Procurement','XMLink/Progressions','Other'}"/>

<s:submit value="submit" align="center" method="addContact"/>


</s:form>
</span>

If i use css property font-weight:bold ,The labels are getting bold and aslo the labels in the checkboxlist ,I dont want the labels in the checkboxlist as bold .....

How do i do that
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
Hi suraj

I guess your way of making the label bold might be useful for me ..

Can you be bit clear ,How i have do in the .properties file ....

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

OVERRIDE THE DEFAULT CSS.

Or create a new theme.

Doing it any other way is not a good idea.
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
Thank you got the answer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do i adjust the label width n make it bold ? in the jsp of Struts2 aplication ?
 
Similar Threads
Problem With I18n feature of Struts2
struts2 tag ?
how should i remove the error message for the required text field once i move to another text field
Validation Framework in struts2
Struts2 - jquery Plugin - Fieldset