You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Suneel <su...@gmail.com> on 2009/04/21 17:29:39 UTC

Non editable jsp with struts 2 templates - whats the best approach?

Hi,

I've a JSP where the user views a set of html input fields. The user
enters the values and submits the page and he is taken to another page
where he gets a chance to review his inputs before final submission.
All this JSP does is, it displays the inputs as plain text instead of
html inputs using the <s:property> tag. Currently I'm using two
different jsps to achive this - one for input and one for review. Can
I do this with just one JSP by using themes/templates like switching
the theme for the review jsp? We are currently using the 'simple'
theme.

-- 
Thanks
Suneel

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


Re: Non editable jsp with struts 2 templates - whats the best approach?

Posted by Suneel <su...@gmail.com>.
Well the problem is if I make a change to first jsp, then I need to
make the same change on the second JSP like adding fields etc. This
really becomes a pain when I have to change the page layout. If it is
just one jsp, I can get away with changing just one page instead of
two. This jsp is huge with 20 inputs .

On Tue, Apr 21, 2009 at 11:06 AM, Lukasz Lenart
<lu...@googlemail.com> wrote:
> 2009/4/21 Suneel <su...@gmail.com>:
>> I've a JSP where the user views a set of html input fields. The user
>> enters the values and submits the page and he is taken to another page
>> where he gets a chance to review his inputs before final submission.
>> All this JSP does is, it displays the inputs as plain text instead of
>> html inputs using the <s:property> tag. Currently I'm using two
>> different jsps to achive this - one for input and one for review. Can
>> I do this with just one JSP by using themes/templates like switching
>> the theme for the review jsp? We are currently using the 'simple'
>> theme.
>
> What is wrong with that approach? If it works and if it's simple, then keep it!
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Thanks
Suneel

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


Re: Non editable jsp with struts 2 templates - whats the best approach?

Posted by Dave Newton <ne...@yahoo.com>.
Lukasz Lenart wrote:
> 2009/4/21 Suneel <su...@gmail.com>:
>> I've a JSP where the user views a set of html input fields. The user
>> enters the values and submits the page and he is taken to another page
>> where he gets a chance to review his inputs before final submission.
>> All this JSP does is, it displays the inputs as plain text instead of
>> html inputs using the <s:property> tag. Currently I'm using two
>> different jsps to achive this - one for input and one for review. Can
>> I do this with just one JSP by using themes/templates like switching
>> the theme for the review jsp? We are currently using the 'simple'
>> theme.
> 
> What is wrong with that approach? If it works and if it's simple, then keep it!

Because it involves maintaining to completely separate JSP pages that do 
almost the exact same thing. If the approach is used throughout the site 
it's more maintainable to abstract that functionality and avoid having 
to make changes in two places every time something on the JSP changes.

Dave


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


Re: Non editable jsp with struts 2 templates - whats the best approach?

Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/4/21 Suneel <su...@gmail.com>:
> I've a JSP where the user views a set of html input fields. The user
> enters the values and submits the page and he is taken to another page
> where he gets a chance to review his inputs before final submission.
> All this JSP does is, it displays the inputs as plain text instead of
> html inputs using the <s:property> tag. Currently I'm using two
> different jsps to achive this - one for input and one for review. Can
> I do this with just one JSP by using themes/templates like switching
> the theme for the review jsp? We are currently using the 'simple'
> theme.

What is wrong with that approach? If it works and if it's simple, then keep it!


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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


Re: Non editable jsp with struts 2 templates - whats the best approach?

Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/4/21 Security Management <li...@secmgmt.com>:
> Yes, create a theme based on simple that sets the disabled=true for the
> fields, and render with that theme.

Some browses don't send to a server disabled fields, so you will have
to duplicate them in to the hidden inputs. You can use readonly=true
but it can be confusing for users, you will have to change the
background or something.


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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


RE: Non editable jsp with struts 2 templates - whats the best approach?

Posted by Security Management <li...@secmgmt.com>.
Yes, create a theme based on simple that sets the disabled=true for the
fields, and render with that theme.

Here's an example of how to do that:

http://mikeski.net/site/node/16



-----Original Message-----
From: Suneel [mailto:suneelgv@gmail.com] 
Sent: Tuesday, April 21, 2009 11:30 AM
To: Struts Users Mailing List
Subject: Non editable jsp with struts 2 templates - whats the best approach?

Hi,

I've a JSP where the user views a set of html input fields. The user
enters the values and submits the page and he is taken to another page
where he gets a chance to review his inputs before final submission.
All this JSP does is, it displays the inputs as plain text instead of
html inputs using the <s:property> tag. Currently I'm using two
different jsps to achive this - one for input and one for review. Can
I do this with just one JSP by using themes/templates like switching
the theme for the review jsp? We are currently using the 'simple'
theme.

-- 
Thanks
Suneel

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


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