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 Simplest Problem 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 "Simplest Problem" Watch "Simplest Problem" New topic
Author

Simplest Problem

Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Hi Guys,
Am a newbie when it comes to Struts. Am just wondering what the following tag wud look like in struts.

My bean(say Hello) has a field phone_number.

in common jsp language i wud say jsp:useBean name="Hello"

<%
if( Hello.getPhone_number().toString().length() == 10)
{
<%=Hello.getPhone_number().subString(0,3)%>
-
<%=Hello.getPhone_number().subString(4,5)%>
-
<%=Hello.getPhone_number().subString(6,9)%>
}
%>

Want a quick solution.


Face Off.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Before you get your quick solution, would you mind changing your display name so that it complies with our naming policy?

Thank you.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

I'll wait until you meet Lasse's request.


A good workman is known by his tools.
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Now This is not done mate. ((((( We all know software engineers are a fancy lot. So what if i am named as a stylish hunk on this site ? (
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Simplest Problem
 
Similar Threads
Is there a find method for strings?
Regex for adding CDATA to XML nodes
Split String Based On String Length issue
No configuration found for the specified action error in netbean
need help with practise questions.