You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hunter Hillegas <li...@lastonepicked.com> on 2003/06/22 20:57:46 UTC

[OT] Question About Second Pass Rendering

Is it possible to do some kind of second pass rendering of JSP content?

I'd like to store markup (HTML+JSTL) in a database. I'd like a Servlet to
retrieve it and send it along to a JSP that renders it along with static
content...

Is there any way to do what I'm suggesting?

It seems like a common CMS design feature.

TIA,
Hunter


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


Struts-menu

Posted by Mykola Ostapchuk <my...@sympatico.ca>.
Hello,

I couldn't get any response from Struts-menu mail list, so I'm wandering if
somebody here could help me.
I'm new to struts-menu. I want to create a role-based expandable menu. I
have an existing system with Roles DB table.
How can I specify menu permissions for particular Role and save it to
menu-config.xml?
Does anybody has any examples?


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


Re: [OT] Question About Second Pass Rendering

Posted by Jing Zhou <ji...@netspread.com>.
Creating custom actions (JSTL/Struts tags) in JSP pages
on the fly is really a bad ideas as suggested by other
Struts experts. From my experience, the servlet container
will invoke a Java compiler to compile every newly created
JSP page, which will take 3 to 10 seconds or more.

Assume your business requirements need dynamic
presentation structures while the data content remained
the same, you have two strategies:

1) Wrap your data by xml documents. You perform
transformation using a style sheet on the fly when
end users request the documents. So you only need
to develop a set of the style sheets for different
presentations. This is generally a simple and quick
way to do it.

2) A better way, I believe, requires more architect
effort, but it removes the performance problems
related to the xml transformation on the fly:

Assume your database contains the xml documents
only for the structures of presentations. You
*publish* the xml documents to the file systems
using a style sheet for each of desired presentations.
So you end up a JSP page for a particular
presentation requirement, for example, PDA.
When a PDA user requests the JSP page, there
is no on-the-fly xml transformation for the
presentations, because it is already transformed
during the publishing process which creates the
JSP page.

As we all know there are three important time
concepts in the servlet spec:
1) Translation Time.
2) Posting Time.
3) Rendering Time.
The 2) and 3) are usually combined and called
Request Time by some experts. The concepts
I am introducing here is the fourth TIME:
Publishing Time.

The Publishing Time is one of core concepts
in advanced tools that deal with multiple
presentations for the same data contents.

Jing
Netspread Carrier
http://www.netspread.com

----- Original Message ----- 
From: "Hunter Hillegas" <li...@lastonepicked.com>
To: "Struts List" <st...@jakarta.apache.org>
Sent: Sunday, June 22, 2003 11:57 PM
Subject: Re: [OT] Question About Second Pass Rendering


> Sure... I want to have a CMS that stores fragments of content in a
database
> that can be inserted into templates. I want that content to include
> Java/JSTL bits, not just text/html...
>
> So the first pass renders the template and grabs the content bits and the
> second pass renders the parts of the content bits that are dynamic
> (Java/JSTL).
>
> Does that make sense?
>
> How is this usually done?
>
> Hunter
>
> > From: "Jing Zhou" <ji...@netspread.com>
> > Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Date: Sun, 22 Jun 2003 20:48:54 -0500
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Subject: Re: [OT] Question About Second Pass Rendering
> >
> >> Is it possible to do some kind of second pass rendering of JSP content?
> >>
> >> I'd like to store markup (HTML+JSTL) in a database. I'd like a Servlet
to
> >> retrieve it and send it along to a JSP that renders it along with
static
> >> content...
> >
> > What is leading you to think of the SECOND pass rendering of JSP
content?
> > Could you explain it a little bit more?
>
>
> ---------------------------------------------------------------------
> 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: [OT] Question About Second Pass Rendering

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Hunter" == Hunter Hillegas <li...@lastonepicked.com> writes:

    Hunter> Sure... I want to have a CMS that stores fragments of content in a database
    Hunter> that can be inserted into templates. I want that content to include
    Hunter> Java/JSTL bits, not just text/html...

    Hunter> So the first pass renders the template and grabs the content bits and the
    Hunter> second pass renders the parts of the content bits that are dynamic
    Hunter> (Java/JSTL).

    Hunter> Does that make sense?

    Hunter> How is this usually done?

It's likely that the dynamic content is represented as XML, and rendered with
XSLT, perhaps from within the JSP code, or in business logic.  It's not
practical for the dynamic content to be represented as JSP code.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




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


Re: [OT] Question About Second Pass Rendering

Posted by Hunter Hillegas <li...@lastonepicked.com>.
Sure... I want to have a CMS that stores fragments of content in a database
that can be inserted into templates. I want that content to include
Java/JSTL bits, not just text/html...

So the first pass renders the template and grabs the content bits and the
second pass renders the parts of the content bits that are dynamic
(Java/JSTL).

Does that make sense?

How is this usually done?

Hunter

> From: "Jing Zhou" <ji...@netspread.com>
> Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Date: Sun, 22 Jun 2003 20:48:54 -0500
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Subject: Re: [OT] Question About Second Pass Rendering
> 
>> Is it possible to do some kind of second pass rendering of JSP content?
>> 
>> I'd like to store markup (HTML+JSTL) in a database. I'd like a Servlet to
>> retrieve it and send it along to a JSP that renders it along with static
>> content...
> 
> What is leading you to think of the SECOND pass rendering of JSP content?
> Could you explain it a little bit more?


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


Re: [OT] Question About Second Pass Rendering

Posted by Jing Zhou <ji...@netspread.com>.
----- Original Message ----- 
From: "Hunter Hillegas" <li...@lastonepicked.com>
To: "Struts List" <st...@jakarta.apache.org>
Sent: Sunday, June 22, 2003 1:57 PM
Subject: [OT] Question About Second Pass Rendering


> Is it possible to do some kind of second pass rendering of JSP content?
> 
> I'd like to store markup (HTML+JSTL) in a database. I'd like a Servlet to
> retrieve it and send it along to a JSP that renders it along with static
> content...

What is leading you to think of the SECOND pass rendering of JSP content?
Could you explain it a little bit more?

> 
> Is there any way to do what I'm suggesting?
> 
> It seems like a common CMS design feature.
> 
> TIA,
> Hunter
> 

Jing

> 
> ---------------------------------------------------------------------
> 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