You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Jonathan Linczak <li...@hiram.edu> on 2004/06/11 17:27:48 UTC

Simple JSP / Lenya question

OK, I kinda asked this question in a previous thread, and I got some 
great links in the Wiki that described XSP and how to connect to 
databases, etc.  I'd like to rephrase my question and see if I can get 
a simpler response.  (Sorry - you have to treat me as a true newbie 
when it comes to this question).

The question is: I want to create a very simple JSP page.  I don't care 
about the template or anything, I just want to create a simple JSP page 
that echos "Hello World!" on the screen in proper XHTML.  Now, I want 
to integrate this into Lenya so that I can see it in the content 
organization hierarchy (menus), yet know I can't edit the output of the 
page using Lenya.  However, I'd like to edit the source from within 
Lenya's "Edit with One Form" and do whatever I need to with the coding. 
  Is this possible?  If so, how can this be done?  I'm looking for a 
step-by-step process on this one if it is possible.  Thanks for any 
help you can pass along.


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


Re: Simple JSP / Lenya question

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Fri, 11 Jun 2004, Jonathan Linczak wrote:

> One, you hinted that this would probably be a bad idea.  Can you
> shed some light as to why this would be a bad idea, and what (in
> as plain English as possible: me = newbie), what would be the
> ideal method of creating dynamic pages through Lenya and Cocoon.
> Just an overview only (like, "the ideal method would be XSP, and
> you can accomplish this in such-and-such a method").

This is mostly a matter of taste, so this is only my opinion.

I consider JSPs problematic in that they intertwine presentation
(HTML) and business logic (Java) together.  Careful use of Java
taglibs can ameliorate the problem but there's no restriction in the
approach from adding any type of processing.  The result is poor
maintenance and reuse characteristics.  XSP has the same issues but
it does have the significant advantage that you can at least
construct well formed XML documents.


> Secondly, you mentioned creating a sufficiently relaxed XML
> document to allow JSP code to be added.  I think I understand, but
> how exactly is this done?  Remember, on the dynamic side, I'm a
> clueless individual with Cocoon and Lenya, so I wouldn't even know
> where to begin to accomplish such as task.  Would you be able to
> elaborate?

This isn't a dynamic side issue, if by dynamic you are referring to
dynamic delivery of your web site.  Its only an issue when authoring
content within Lenya.

Generally, the Lenya tool chain will try to validate the correctness
of the documents you are authoring against the document type it is
declared to be an instance of.  So you have to make sure the
document type you are using allows the content you want to include.
Check the Lenya wiki
(http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType)
for instructions on how to add your own custom types.

An alternative is to disable validation in the One Form editor.  I'm
not sure how this is done.  Hopefully, someone else on the list can
fill in this detail.

-- 
JP




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


Re: Simple JSP / Lenya question

Posted by Jonathan Linczak <li...@hiram.edu>.
Thanks Jean, I think I'm getting better at understanding the dynamic 
side of Lenya and Cocoon, but still more questions on this topic.

One, you hinted that this would probably be a bad idea.  Can you shed 
some light as to why this would be a bad idea, and what (in as plain 
English as possible: me = newbie), what would be the ideal method of 
creating dynamic pages through Lenya and Cocoon.  Just an overview only 
(like, "the ideal method would be XSP, and you can accomplish this in 
such-and-such a method").

Secondly, you mentioned creating a sufficiently relaxed XML document to 
allow JSP code to be added.  I think I understand, but how exactly is 
this done?  Remember, on the dynamic side, I'm a clueless individual 
with Cocoon and Lenya, so I wouldn't even know where to begin to 
accomplish such as task.  Would you be able to elaborate?

I hope my rather small and menial questions are helping some users out 
there, but if I'm getting annoying to everyone, just fill me in.  :)

Jon


On Jun 11, 2004, at 12:20 PM, Jean Pierre LeJacq wrote:

> On Fri, 11 Jun 2004, Jonathan Linczak wrote:
>
> > The question is: I want to create a very simple JSP page.  I don't
>  > care about the template or anything, I just want to create a
>  > simple JSP page that echos "Hello World!" on the screen in proper
>  > XHTML.  Now, I want to integrate this into Lenya so that I can see
>  > it in the content organization hierarchy (menus), yet know I can't
>  > edit the output of the page using Lenya.  However, I'd like to
>  > edit the source from within Lenya's "Edit with One Form" and do
>  > whatever I need to with the coding.
>
> Leaving aside whether this is a good idea :-)... yes you can do
>  this.
>
> You need to have a sufficiently relaxed XML document type for your
>  content documents that will allow JSPs (essentially relaxing the
>  validation).  Ideally, you would define a set of JSP taglibs but my
>  guess is you want to enter Java code directly through the form
>  editor.  You may need to escape the Java code within CDATA blocks.
>  Also, you should understand that you may have trouble with
>  subsequent cocoon transformers/serializers if the resulting document
>  is not at least well formed XML.
>
> -- 
> JP
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-user-help@cocoon.apache.org

Re: Simple JSP / Lenya question

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Fri, 11 Jun 2004, Jonathan Linczak wrote:

> The question is: I want to create a very simple JSP page.  I don't
> care about the template or anything, I just want to create a
> simple JSP page that echos "Hello World!" on the screen in proper
> XHTML.  Now, I want to integrate this into Lenya so that I can see
> it in the content organization hierarchy (menus), yet know I can't
> edit the output of the page using Lenya.  However, I'd like to
> edit the source from within Lenya's "Edit with One Form" and do
> whatever I need to with the coding.

Leaving aside whether this is a good idea :-)... yes you can do
this.

You need to have a sufficiently relaxed XML document type for your
content documents that will allow JSPs (essentially relaxing the
validation).  Ideally, you would define a set of JSP taglibs but my
guess is you want to enter Java code directly through the form
editor.  You may need to escape the Java code within CDATA blocks.
Also, you should understand that you may have trouble with
subsequent cocoon transformers/serializers if the resulting document
is not at least well formed XML.

-- 
JP



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