RE: a couple of questions

2003-01-06 Thread pqin
The template is like a super class, include jsp is like a subclass, can you
inherit super class imports in your subclass? No. 

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Yan Zhu [mailto:[EMAIL PROTECTED]] 
Sent: January 6, 2003 11:37 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: a couple of questions

>
>
>One, possibly hokie way, of doing this would be to use parameters in your
resources.  For example, say your error resource is defined as
>This makes the *entire* text of foo.error dynamic.
>

excellent, that is awesome!
no way to make individual prefix based on class though? :(

>I have a root page layout tile that is something like:
>
><%@ include file="header.jsp" %>
>
>  .
>  .
>  
>  .
>  .
>  
>  .
>  .
>
>
>My individual tiles extend the layout tile.  The extensions in turn specify
the actual the values for the 'title' and 'body' attributes.  However, I
don't have to repeat 'hea
>
hmm, i have done the same thing, but my jsp imports etc don't seem to 
come over to each individual tiles..


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



Re: a couple of questions

2003-01-06 Thread Yan Zhu


One, possibly hokie way, of doing this would be to use parameters in your resources.  For example, say your error resource is defined as
This makes the *entire* text of foo.error dynamic.



excellent, that is awesome!
no way to make individual prefix based on class though? :(


I have a root page layout tile that is something like:

<%@ include file="header.jsp" %>

 .
 .
 
 .
 .
 
 .
 .


My individual tiles extend the layout tile.  The extensions in turn specify the actual the values for the 'title' and 'body' attributes.  However, I don't have to repeat 'hea


hmm, i have done the same thing, but my jsp imports etc don't seem to 
come over to each individual tiles..


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: a couple of questions

2003-01-06 Thread Sri Sankaran


> -Original Message-
> From: Yan Zhu [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, January 05, 2003 10:57 AM
> To: Struts Users Mailing List
> Subject: a couple of questions
> 
> 
> 
> hey guys,
> 
> using struts 1.1 beta 3 here with tomcat 4.1.18.
> 
> pretty much a newbie with struts ...
> 
> first of all, I am trying to use ActionError to create 
> some error messages during validation. is there anyway to 
> customize your error message instead of getting from the 
> resource file? sometimes my message content is dynamic. If I 
> wish to extend the original ActionError to implement this 
> feature, how would I go about it? seems a bit tough without 
> modifying original class.

One, possibly hokie way, of doing this would be to use parameters in your resources.  
For example, say your error resource is defined as

foo.error=Don't ever {0}

and then you can create an error as 

ActionError a = new ActionError("foo.error", "do that again.");

the following JSP will display "Don't ever do that again".



A limiting case of this would be where foo.error is defined as follows

foo.error={0}

This makes the *entire* text of foo.error dynamic.

> 
> in the resource file, you can specify error.perfix etc, 
> but you can't do this hiarchinally i suppose? it'd be much 
> nicer if for error.login, you can define error.login.prefix, 
> that way your error messages will look different based on 
> different types of errors. if this can't be done, might be a 
> good improvment in the future.
> 
> I am also using tiles, which is a cool feature, but here 
> is my problem. I have a template with tile insert a few other 
> files, let's call them a.jsp and b.jsp. How do I do jsp 
> import or other things on a template level so I don't have to 
> do it over and over again for a.jsp and b.sjp.
> 
> for example, I like to be able to include a init.jsp in 
> my template, so that I don't need to include one for a.jsp 
> and b.jsp individually. I tried it, doesn't seem to work.

I have a root page layout tile that is something like:

<%@ include file="header.jsp" %>

  .
  .
  
  .
  .
  
  .
  .


My individual tiles extend the layout tile.  The extensions in turn specify the actual 
the values for the 'title' and 'body' attributes.  However, I don't have to repeat 
'header.jsp'.

> 
> thanks in advance.
> 
> yan
> 
> 

Sri

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: a couple of questions

2003-01-05 Thread Joseph Fifield
I extended the ErrorsTag to add a feature very similar to this, for a
slightly different reason. I wanted to display all global errors at the top
of the screen, and all field specific errors below it's respective form
field. However, for this to look right, I needed a different set of prefixes
and suffixes, which I called a "decoration set", for global errors and field
errors. I added a property called decorationSet, which indicated the set of
resource keys to use for this instance. A decorationSet of "global" would
result in using the keys errors.global.prefix, etc. Maybe something like
this is useful to others? And maybe someone can come up with a better name
than decoration set?

Joe

> in the resource file, you can specify error.perfix etc, but you
> can't do this
> hiarchinally i suppose? it'd be much nicer if for error.login, you can
> define
> error.login.prefix, that way your error messages will look different
> based
> on different types of errors. if this can't be done, might be a good
> improvment
> in the future.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: