You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mailing List <ma...@pdpsoft.com> on 2004/01/29 11:53:34 UTC

Using "bean:write" as a tag's value atrribute

Dear All;

Using <bean:write name="myBeanName" property="its property"> works properly
in my jsp page body. But when I want to use it in a tag to fill its
attribute, it fails.
 Actually I don't know the syntax of using bean:write, obviously the below
way is wrong:

<someTag value="<bean:write name="myBeanName" property="its property">">

Using expression is wrong, too:

<someTag 
     value="<%=<bean:write name="myBeanName" property="its property">%>">

So how could I use bean:write in my tags?!

Any help would be greatly appreciated
Nafise


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Regarding Server Side Validation in Struts

Posted by shankarr <sh...@adventnet.com>.
Hi!
My $0.02 on this.
As a design, it is best if we let the db throw exception and we handle it 
using ActionError/ActionMessage in the Action file.
I feel it is better that way. Then, you can formulate the page using 
<html:errors/> and the application.resources .
This is my understanding.
I am willing to learn though.

Richie

At 05:31 PM 1/29/2004 +0530, you wrote:

>Hi all,
>
>              Can any one can tell, how to perform server side validation 
> using struts. For example there is foem called departments, here depname 
> is unique. How can i perform here.
>
>              I know the logic at all. But is there any validator here.Can 
> any one have any idea. Please mail regarding this...
>
>Thanks,
>Ram
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org

"To achieve all that is possible, one must attempt the impossible"



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using "bean:write" as a tag's value atrribute

Posted by Nicolas De Loof <ni...@cgey.com>.
<bean:define id="value" name="myBeanName" property="its property">
<someTag value="<%= value %>">

Nico.



> 
> Dear All;
> 
> Using <bean:write name="myBeanName" property="its property"> works properly
> in my jsp page body. But when I want to use it in a tag to fill its
> attribute, it fails.
>  Actually I don't know the syntax of using bean:write, obviously the below
> way is wrong:
> 
> <someTag value="<bean:write name="myBeanName" property="its property">">
> 
> Using expression is wrong, too:
> 
> <someTag 
>      value="<%=<bean:write name="myBeanName" property="its property">%>">
> 
> So how could I use bean:write in my tags?!
> 
> Any help would be greatly appreciated
> Nafise
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using "bean:write" as a tag's value atrribute

Posted by Claire Wall <cl...@kurtosys.com>.
This is fine as long as the tag you're using the <bean:write.../> is not
another custom tag e.g. <html:.../> or <logic:.../> etc. It is done like
this:

<input type="submit" value="<bean:write name="FormName"
property="Property"/>" /> - make sure you include '/' at the end of the bean
tag.


If you want to use this in a custom tag you're going to have to define a
bean first and then use a jsp expression so you can set the value like so:

<bean:define id="prop" name="FormName" property="Property"/>

<html:option value="<%= prop %>"/>


hope this answers your question

claire :)

----- Original Message -----
From: "Mailing List" <ma...@pdpsoft.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, January 29, 2004 10:53 AM
Subject: Using "bean:write" as a tag's value atrribute


>
> Dear All;
>
> Using <bean:write name="myBeanName" property="its property"> works
properly
> in my jsp page body. But when I want to use it in a tag to fill its
> attribute, it fails.
>  Actually I don't know the syntax of using bean:write, obviously the below
> way is wrong:
>
> <someTag value="<bean:write name="myBeanName" property="its property">">
>
> Using expression is wrong, too:
>
> <someTag
>      value="<%=<bean:write name="myBeanName" property="its property">%>">
>
> So how could I use bean:write in my tags?!
>
> Any help would be greatly appreciated
> Nafise
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Shall i use two form beans under one Action

Posted by Ramachandran <ra...@summitworks.com>.
Hi,
           Shall i use two form beans under one action. Is it possible. I am having 

     1) LoginForm
     2) LoginAction
     3) RequirementForm

        Here when the users login, i want to display the home jsp, caontains menu. For that i am having username and password fields in LoginForm.

        And also for displaying requirements, i am having all fields in RequirementForm. So i want to writ the code in LoginAction itself but i want to use another form bean(RequirementForm) in that Action itself.

        Any body have experience like that, please mail your opinion.

Thanx,
Regards,
Ram

           

-----Original Message-----
From: Ramachandran [mailto:ramachandran@summitworks.com]
Sent: Thursday, January 29, 2004 7:27 PM
To: Struts Users Mailing List
Subject: select box in struts


Hi,

           I am having a table called employees. I want to display all the employees in the "select box" in an jsp when i click a link called 'Deactive'.

           For that what i have to do.......Is there any way in struts using <html:select>

           Any body knows, give your queries....
Thanx,
Regards,
Ram


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


select box in struts

Posted by Ramachandran <ra...@summitworks.com>.
Hi,

           I am having a table called employees. I want to display all the employees in the "select box" in an jsp when i click a link called 'Deactive'.

           For that what i have to do.......Is there any way in struts using <html:select>

           Any body knows, give your queries....
Thanx,
Regards,
Ram


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Regarding Server Side Validation in Struts

Posted by Ramachandran <ra...@summitworks.com>.
Hi all,

             Can any one can tell, how to perform server side validation using struts. For example there is foem called departments, here depname is unique. How can i perform here.

             I know the logic at all. But is there any validator here.Can any one have any idea. Please mail regarding this...

Thanks,
Ram


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org