Re: Struts2/Velocity Integration

2011-04-19 Thread Eric Lentz
 I'm working on a legacy system that is built on jsp.  In one of the jsps
 I need to include a velocity template.  The template does not require
 access to any dynamic data.

Struts lets you use Velocity instead of JSPs as an option. Using JSPs 
*and* Velocity isn't an out-of-the-box type of thing, I don't believe. 
What I might consider, and there might be a better way, would be to use a 
String type field in my action, render the Velocity template within the 
action (or in a facade, helper or extended class) and assign that output 
to the String. Then, in the JSP, use a s:property  where the name of it 
is the String that you assigned the output from Velocity. That should just 
dump everything that was rendered from the template.

Make sense? Other people with better ideas?

- Eric

Re: Struts2/Velocity Integration

2011-04-19 Thread Dave Newton
Check back in the list; we just discussed this topic within the last few days.

Dave

On Tue, Apr 19, 2011 at 1:55 PM, Eric Lentz eric.le...@sherwin.com wrote:
 I'm working on a legacy system that is built on jsp.  In one of the jsps
 I need to include a velocity template.  The template does not require
 access to any dynamic data.

 Struts lets you use Velocity instead of JSPs as an option. Using JSPs
 *and* Velocity isn't an out-of-the-box type of thing, I don't believe.
 What I might consider, and there might be a better way, would be to use a
 String type field in my action, render the Velocity template within the
 action (or in a facade, helper or extended class) and assign that output
 to the String. Then, in the JSP, use a s:property  where the name of it
 is the String that you assigned the output from Velocity. That should just
 dump everything that was rendered from the template.

 Make sense? Other people with better ideas?

 - Eric

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



RE: Struts2/Velocity Integration

2011-04-19 Thread Biesbrock, Kevin
From: Dave Newton [mailto:davelnew...@gmail.com] Tuesday, April 19, 2011
2:18 PM
 we just discussed this topic within the last few days.

If you're referring to my previous question, that was never resolved.
It was left with:

 From: Dave Newton [mailto:davelnew...@gmail.com] 
 Do the templates use the same models as the web layer?

 Actually, it would have been good to note that the contact information
is hard-coded.  So there is no need for a model.  
 I literally just need to include a block of html-/css-formatted text
[in both a class and a jsp].

There was no response to that and I didn't want to specifically call you
out for a response because I recognize that you're a developer, too, and
are busy with your own shtuff.



From: Eric Lentz [mailto:eric.le...@sherwin.com] Tuesday, April 19, 2011
1:55 PM
 render the Velocity template within [a facade].

Sounds like my original thought -- something like this:
action name=getTemplate_*
result
type=velocity/WEB-INF/myVelocityTemplates/{1}.vm/result
/action



From: Martin Gainty [mailto:mgai...@hotmail.com] Tuesday, April 19, 2011
2:01 PM
 can you confirm these entries in your struts webapp?

Confirmed.  I have not yet tried the facade method mentioned above.  I
originally saw that as an option but didn't know if there was a better
way e.g., the VelocityViewTag -- which only appears to be supported with
Struts1 (perhaps replaced by the velocity return type in Struts2?).

Thank you, gentlemen, for your time and timely responses.

Sincerely,
-Beez


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



Re: Struts2/Velocity Integration

2011-04-19 Thread Dave Newton
On Tue, Apr 19, 2011 at 2:34 PM, Biesbrock, Kevin wrote:
 There was no response to that and I didn't want to specifically call you
 out for a response because I recognize that you're a developer, too, and
 are busy with your own shtuff.

The response was embedded/implied; if there's no data model at all
then it doesn't matter if you have a simple tag around template
rendering or within the action itself. Going through an entire request
process is unnecessary.

Dave

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



RE: Struts2/Velocity Integration

2011-04-19 Thread Biesbrock, Kevin
From: Dave Newton [mailto:davelnew...@gmail.com] Tuesday, April 19, 2011
2:41 PM
The response was embedded/implied; if there's no data model at all then
it doesn't matter if you have a simple 
tag around template rendering or within the action itself. Going
through an entire request process is unnecessary.

I understand that point.  I apologize, but I'm a little unclear as to
what you're actually suggesting I do.  One option, I gather, is the same
thing Eric suggested -- render the template in the action class and put
the result into a string for the view to pull using s:property.../.
Is that correct?

What about the simple tag concept?  How would I implement that in my
view?  That's the solution I was hoping to find; as I feel it's more
MVC-compliant.


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



Re: Struts2/Velocity Integration

2011-04-19 Thread Dave Newton
On Tue, Apr 19, 2011 at 2:50 PM, Biesbrock, Kevin wrote:
 One option, I gather, is the same
 thing Eric suggested -- render the template in the action class and put
 the result into a string for the view to pull using s:property.../.
 Is that correct?

Yeah, although I'd just use JSTL ${whatever}

 What about the simple tag concept?  How would I implement that in my
 view?  That's the solution I was hoping to find; as I feel it's more
 MVC-compliant.

v:renderTemplate template=theTemplate.vm/ or whatever.

Dave

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



RE: Struts2/Velocity Integration

2011-04-19 Thread Biesbrock, Kevin
Now we're narrowing in:

 v:renderTemplate template=theTemplate.vm/

Do I need to create my own taglib for 'v'?  There seems to be little
documentation with regard to this for Struts2 and Velocity.  But this is
the very thing I would like to accomplish.  Or perhaps I'm overlooking
it; could you point to documentation for this?


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



Re: Struts2/Velocity Integration

2011-04-19 Thread Dave Newton
You'd create a tag; there aren't any out-of-the-box in S2, although
there might be a third-party taglib that'd do it. It's really, really
easy.

Dave

On Tue, Apr 19, 2011 at 3:03 PM, Biesbrock, Kevin
biesbrock.ke...@aoins.com wrote:
 Now we're narrowing in:

 v:renderTemplate template=theTemplate.vm/

 Do I need to create my own taglib for 'v'?  There seems to be little
 documentation with regard to this for Struts2 and Velocity.  But this is
 the very thing I would like to accomplish.  Or perhaps I'm overlooking
 it; could you point to documentation for this?


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



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



RE: Struts2/Velocity Integration

2011-04-19 Thread Biesbrock, Kevin
From: Dave Newton [mailto:davelnew...@gmail.com] Tuesday, April 19, 2011
3:06 PM
 You'd create a tag; there aren't any out-of-the-box in S2, although
there might be a third-party taglib that'd do it. It's really, really
easy.

Okay.  Just not something I've done previously.  No better time to
learn!

Thank you for your patience! 

Sincerely,
Beez


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