RE: Retrieve Data From WebServer

2006-08-30 Thread Anil Kumar T

Hi,
I was also having similar problem some time back. According to my
knowledge...

If the data is common to all the users then may be you can have a
singleton class and then only once you can populate the data, and every
time you use the same data.

If the data is user specific then I think storing in the session is
must.

Lets wait about the others ideas also...

Cheers,
Anil.

-Original Message-
From: Rokariya, Raman [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 31, 2006 10:20 AM
To: user@struts.apache.org
Subject: Retrieve Data From WebServer

Hi,

I am developing web client using Struts Framework. I am facing a problem
in following scenario.

I have an arraylist of Data , which is populated in Table Grid using
Display-Tag library. The first time when the page appears, the data
comes from the Database.

It is working fine for the first time . However, my page refreshes after
some interval , say 5 mins, during subsequent refreshes, I don't want
that the data should again come through the Database call. I have tried
using ThreadLocal utitity, however it doesn't work.

I have tried using JSP Session object, and it worked. However, I want to
avoid the use of Session object in the project.

Any solution/Ideas would be highly appreciated.

Thanks
Raman







Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

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



Retrieve Data From WebServer

2006-08-30 Thread Rokariya, Raman
Hi,

I am developing web client using Struts Framework. I am facing a problem
in following scenario. 

I have an arraylist of Data , which is populated in Table Grid using
Display-Tag library. The first time when the page appears, the data
comes from the Database.

It is working fine for the first time . However, my page refreshes after
some interval , say 5 mins, during subsequent refreshes, I don't want
that the data should again come through the Database call. I have tried
using ThreadLocal utitity, however it doesn't work.

I have tried using JSP Session object, and it worked. However, I want to
avoid the use of Session object in the project.

Any solution/Ideas would be highly appreciated.

Thanks
Raman








Re: validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz

Thanks a lot for all that feedback. I think it gets me a step further.

Tom


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



Re: Antwort: Re: Creating new Session without invalidating the old one [*]

2006-08-30 Thread David Durham

[EMAIL PROTECTED] wrote:

Hello!


Thank you to all for your hints. Now, I want to tell you, what I did at last.

My application consists of nearly 100% forms. The application is logically
devided into two parts (-> represented by two browser windows), and it must be
possible to get from one part to the other. If somebody goes to the other part,
datas must be migrated from the first one, which needn't to be closed - it's
possible, that the user works with both parts at the same time.

To achieve these needs, I created an object in the ServletContext, where datas
are stored, which are needed to migrate from one session to another session. The
key to these data in this object is the session ID. If an user switches to
another part of the application, this is done using a direct call to a jsp, like

href=some.jsp;sessionid=E19593A3AB3BB4EBB92C6E64916B729C

I'm using sessionid (and not jsessionid), because this way, the request is
sessionless (I'm using URL-rewriting for session-tracking and https) and I can
check in the loginfilter myself, if the request belongs to an already logged in
user. If the sessionid is valid, the user gets a new one and I can fetch data
from the ServletContext-object.



My thinking was to put 2 objects in a single session, each representing 
a respective window's attribute.  1 session, 2 "windows".


You could just have this new Window class extend HashMap to get 
key-value pairs.



-Dave

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



Re: [Shale] Old form values still there after "Cancel" button.

2006-08-30 Thread Craig McClanahan

On 8/30/06, Jason Vincent <[EMAIL PROTECTED]> wrote:


Hi all,

For the life of me I can't get JSF to stinkn forget values that were
entered on a form.
The view controller is "request" scope.



Are you using Shale for this?  If so, you'd be best off joining the Shale
user list, as Shale is now it's own top level project.  See <
http://shale.apache.org/mail-lists.html> for  signup details.


If I start to enter data in a form and then click the "Cancel" button,

which has immediate="true",  the values entered by the user reappear
in the form when I return to the page.  The action of the Cancel
button returns "home" which maps to a navigational rule to the home
page that is a "redirect".

I've tried these two things which haven't worked:

1) traverse the ViewRoot looking for UIInputs and setting the
submitted value to null.
2) set the value binding to the VC managed bean to null.  I had read
that JSF will reuse evaluated expressions if they aren't null.



Setting the cancel button's immediate property to "true" is the right
general behavior, because you want to bypass validation and model value
updates.  However, that should actually be irrelevant if you are redirecting
to the new page.  The only way I can think of that you should expect the
behavior you describe is if you have bound components on the page to a bean
that is in session scope, rather than request scope.

Any help is greatly appreciated.

Jason

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



Craig


[Shale] Old form values still there after "Cancel" button.

2006-08-30 Thread Jason Vincent

Hi all,

For the life of me I can't get JSF to stinkn forget values that were
entered on a form.
The view controller is "request" scope.

If I start to enter data in a form and then click the "Cancel" button,
which has immediate="true",  the values entered by the user reappear
in the form when I return to the page.  The action of the Cancel
button returns "home" which maps to a navigational rule to the home
page that is a "redirect".

I've tried these two things which haven't worked:

1) traverse the ViewRoot looking for UIInputs and setting the
submitted value to null.
2) set the value binding to the VC managed bean to null.  I had read
that JSF will reuse evaluated expressions if they aren't null.


Any help is greatly appreciated.
Jason

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Wendy Smoak

On 8/30/06, Tom Bednarz <[EMAIL PROTECTED]> wrote:


What is the correct or preferred way to link business-objects with form
beans. Is this only possible by copying data from a business object to a
form bean or is there any 'smarter' way?


You might want to take a look at FormDef: https://formdef.dev.java.net/

--
Wendy

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread David Durham

Tom Bednarz wrote:

So I used



Don't specify value.  Simply copy the properties from a subscriber 
object (session scoped or otherwise) to a formbean (the one being used 
to render the form values).  There's a copyProperties method in 
org.apache.commons.beanutils.BeanUtils:


  http://tinyurl.com/zp6ag

Also, the Spring Framework has a copyProperties method in one of its 
utility classes.  It has the advantage of not throwing a checked 
exception and its parameter ordering makes more sense to some (myself 
included).


A reason to not specify a value for html:text, at the view level, is 
that it overwrites the value in an associated form-bean object.  This 
could lead to overwriting user input or overwriting data that was 
populated from an Action.


It may be acceptable to specify value on a checkbox, for instance, 
because user's don't typically interact with this value directly. 
Still, if a value for a checkbox, like any other form control, was set 
in a controller class, then a page level value will overwrite data.  At 
the very least, this is counterintuitive.  More often, it is incorrect.



-Dave

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz
Thanks a lot for all your input and help. It looks like I need some 
basic concepts clarified. Here a very short background of the 
application and what my intension is:


The object 'subscriber' is a special business object: it represents the 
logged in user and contains a lot of information about him: Personal 
data like name, address, e-mail, preferred language etc. But it contains 
also information about his roles, type of subsciption he bought etc. 
Shortly I need parts of this information almost everywhere in the 
application and thats why the thing sits in session scope.


The action we were discussing 'changePersonalDataForm' represents a form 
where the user can change some of this informations such as personal 
data, language etc. Other things such as roles, subscibtion information 
etc are not visible to the user. The object has logic to retrieve its 
information from various database tables and also store information back 
if there are changes. This is performed exclusively in this object not 
in any action. The object is created and filled when the user has 
successfully logged in.


So I used 




to initially fill the firstname directly from the business object into 
the form. If the user submits the form the information is updated in the 
object and also written back to the DB server. Nice things like 
ChangeEventListeners as available in Swing and also in JSF are sort of 
missing in Struts (at least I did not find something alike)


So the key question seems to be:

What is the correct or preferred way to link business-objects with form 
beans. Is this only possible by copying data from a business object to a 
form bean or is there any 'smarter' way? Copying ends up in writing a 
lot of copy-code which is inefficient. I am looking for sort of a 
component model, which means I have a couple of objects in session or 
even application scope and can directly use then in many different 
forms/actions. But so far I am missing a concept like SWING controls do 
have it where you can bind controls such as a listbox, textbox etc 
directly to objects or even database tables. I think JSF offers similar 
things but I don't see anything alike in struts 1.2.8 (the version I am 
currently using).


Maybe someone could clarify these things for me or you may have some 
good recipes for me, how to solve these things best with Struts.



Many thanks again for your help!

Tom


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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Laurie Harper

Tom Bednarz wrote:

David Durham wrote:

Tom Bednarz wrote:
I think the validator fires too early, but probably I am doing 
something wrong. Maybe somebody can hp!


Basically, you need 2 actions, one to populate the form and one to 
change the personal data.


Or at least two action mappings, if you want to use automatic 
validation. If you're happy to invoke validation manually, you can get 
by with just one action and one mapping.


This is EXACTLY what I like to AVOID! With this concept I have to write 
dozends of useless action classes!


Nope, with that approach you would simply *seperate* your one action 
class into two classes which each encapsulate one branch or your if 
statement below -- i.e. an action that does 'Populate the form' and one 
that does 'Perform update operation'.


If you don't like having two separate classes, there are various options 
for combining them, including the various flavours of dispatch action 
and the approach you illustrate below.



In my Action class I did:

public ActionForward execute(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
{
ActionForward af = null;
..

String operation = request.getParameter("operation");
.

if (operation != null &&
operation.compareToIgnoreCase("update") == 0)
{
. Perform update operation here
}
   else  // showData
   {
 Populate form here
   }
   return (new ActionForward("/showPersonalData.do"));
}

The surprising thing (at least for me...) is, that when running in the 
debugger, execute method is NEVER called (does not stop at any 
breakpoint) !!!


Do you have validate="true" on your action mapping? If validate is set 
to true, the framework will perform validation for you automatically 
before invoking the action. Hence, you need to either a) have two action 
mappings in your config (note: two mappings, not necessarily two action 
classes), one with validate=false and operation set to null and one with 
validate=true and operation set to whatever; or b) using a single action 
mapping, set validate=false and call validate() manually as appropriate.


Is there no more intelligent way then creating lots of actions?? Maybe 
this is a motivation to move to JSF!!


L.


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



Extending tag libraries

2006-08-30 Thread Scott Van Wart

This is a little OT, but it, uh, kind of has to do with Struts :).

I'm interested in adding a few attributes to some of the struts tags.  
They're really only useful in the context of a specific web project I'm 
working on, so I'd really prefer not to edit the Struts TLD and 
implementation (for various other reasons too :).


Problem is, a lot of these have to do with view/layout, so I wanted to 
use .tag files.  Everything's fine if I extend a single property, say 
:


 <%@ attribute name="property" required="true" type="java.lang.String" %>

 

Problem is, there are a lot more attributes, most are optional, and 
different permutations, etc.  Is there a relatively easy way of doing 
this in .tag files?  Do I have to use tag classes and, if so, is it 
possible to tell the JSP processor to re-compile the stuff I output so 
it doesn't write  verbatim to the client?


- Scott

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Wendy Smoak

On 8/30/06, Tom Bednarz <[EMAIL PROTECTED]> wrote:


The idea is, that I show a form that contains already data and the user
can edit it. When the form is submitted, the validator should check the
user input. Here is my validator configuration:

...

Now it seems, that the validator gets fired BEFORE the form is filled!
In the JSP that displays the form, I get lots of error messages all
fired by the 'required' validator saying, that the field must not be
empty, but all fields are filled corretly!!.


Request -> form bean population -> validation -> Action.execute() ->
forward -> JSP

My advice is to turn off automatic validation, and call it explicitly
when you want it to happen.  That will stop the 'validation errors on
first form display' problem.

Looking at your config, you always pull values from a session scoped
'subscriber' object.

I don't think you need 'value' here:

   

The 'name' attribute [1] is "The attribute name of the bean whose
properties are consulted when rendering the current value of this
input field."

Does this work?

   

Even after dealing with the 'first display' problem, that still leaves
you validating the form bean (which may be missing data) yet
displaying values from some other bean sitting in session scope.

[1] http://struts.apache.org/1.x/struts-taglib/tlddoc/html/text.html

--
Wendy

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



Re: Best way to secure struts-webapps?

2006-08-30 Thread Laurie Harper

Thomas Hamacher wrote:

Laurie,

thanks for the input. I am aware of the container managed security. But as far 
as I read in the internet, there is no good solution to use container managed 
security together with tiles. So if I wanna have a login-box on every page, 
that redirects dynamically to the same page after login I will have some 
trouble with the container managed solution. Is this not true or did I 
misunderstood anything? 


It all depends on exactly what you need to achieve. CMS uses URL 
matching, so you'd probably have to have some way to have two distinct 
URL mappings for each page, one secured and one not, and have the login 
box forward to the secured page -- e.g. if you're on /foo.do, have the 
login box forward/redirect to /secure/foo.do. I haven't tried any of 
this though, so I'm just guessing at a possible solution.


And another question to the filter-based solution as Leon also recommended: 
Does this also work if I have different tiles for one page and some of them 
are secured and some aren´t? E.g. I have a tile for an adminMenu, which is 
only loaded if I have a user with admin-roles in the session, but which is 
part of a usual public tiles-page? This way the servlet-filter will never 
find it´s pattern, will it? Is there a simple -Tag combined 
with an entry "role" in the action mapping and role-security-check in the 
RequestProcessor enough security to be sure, only admins access these 
actions? Or is there a way to get around these security-checks, which I 
should keep in mind?


Generating different content based on the current user role is really 
orthogonal to how you establish user credentials -- that's access 
control as opposed to authentication. Once you have the user 
authenticated, be it via CMS, a filter or something else, you can then 
employ various techniques (including, but not limited to, Antonio's 
Dimensions project) to control the visibility of content.


L.


Thank you very much

Thomas


Am Dienstag, 29. August 2006 22:01 schrieb Laurie Harper:

You left container managed security off your list; that's the most
'standard' solution, but isn't necessarily the most portable since parts
are container implementation defined. A filter is probably the most
flexible alternative if container managed security isn't viable, but it
really depends on your exact security requirements.

This is a topic that's discussed alot, both here on the Struts lists,
and in other web development forums, so I'd recommend doing some reading
to get a feel for the solutions others have used and their tradeoffs.

L.

Thomas Hamacher wrote:

Hi everyone,

I think I have a very basic question here, but after spending some time
with google I haven´t found a real solution to this question: What is the
best way to secure a struts webapplication to be sure, that only logged
in users are allowed to do some special action and access some special
pages?

I found 3 possibilities, from what some of them seem to be a solution
from older struts versions.

- Extend the RequestProcessor and do a programmatic security-check
- Use a Filter to do the security check
- Extend all Actions from a customized BaseAction, that does the security
check.

But all of this seems a bit strange to me. As security is a
standard-problem in every webapplication and there are a lot of people
who thought about solutions (JAAS) I can´t believe, that I have to extend
the struts-framework myself to provide some security issues.

So what would you recommend if you want to do a real secure application
with struts, together with tiles and want to be sure, that no pages or
actions are used without permission? And all of this independent, if I
use a Tomcat, a Resin or maybe a JBoss as my struts-web-server.

Do you have any informations, examples or URL´s who have a real solution
to this?

THank you very much

Thomas

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






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



RE: validator and DynaValidatorActionForm

2006-08-30 Thread David Friedman
Why are you making these fields so complex?  You have

   

Instead of the simple form:

 ?

Why do you need to specify all of that redundant information like value and
name when you have the property attribute?  And why are you pulling values
from the session scope instead of the request data that was submitted?  That
seems an unusual choice to my thinking.

Also, what is your html:form action specified there?  Is it listed as
"/changePersonalDataForm"? Or another form name?  Using a different form
might be your problem - after all the html:form uses the bean associated
with that form so a different bean would have different values, especially
if you are mixing and matching values from a session scoped bean with a
request that has its own values.

Regards,
David

-Original Message-
From: Tom Bednarz [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 12:34 PM
To: Struts Users Mailing List
Subject: validator and DynaValidatorActionForm


I think the validator fires too early, but probably I am doing something
wrong. Maybe somebody can hp!

I have the following form bean defined in struts-config.xml:

 










 


and the following action mapping:

 
   
   
 


The idea is, that I show a form that contains already data and the user
can edit it. When the form is submitted, the validator should check the
user input. Here is my validator configuration:



   
 
   
   
 
   
   
 
   
   
 
   
   
 
   
   
 
   
   
 
 
   


Now it seems, that the validator gets fired BEFORE the form is filled!
In the JSP that displays the form, I get lots of error messages all
fired by the 'required' validator saying, that the field must not be
empty, but all fields are filled corretly!!.

Here is an extract of the JSP:


   
 

 
 
   
 
 

 
   
   
 
   
 
 
   
 
 
   
 
   
   ...

  

Every row contains a label, an input control and a TD to display
validation errors of the specific field.

Does anybody know what is going wrong here??

Many thanks for your help!

Tom


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



Re: Dynamically Initializing Checkbox Value

2006-08-30 Thread Laurie Harper
Yes you do, the form is passed in as one of the parameters to execute(). 
The typical pattern is for the action to be invoked via an action 
mapping, populate the form bean and forward to the JSP. It's during this 
action processing that you copy your business data into the form bean, 
thus initializing it.


The form in the JSP is then bound to the form bean, both reading from 
and writing to the same place. When the form is submitted, another 
action is invoked and in that action you copy the appropriate data from 
the form to wherever you need it to complete the operation.


To answer your earlier question, you *can* have a form which takes its 
values from a bean other than the form bean -- I think you've already 
had that working for some input types. However, in the case of 
checkboxes, that's going to be problematic, since the input's value is 
doing double duty -- it's specifying the value that should be submitted 
*if* the checkbox is selected, and also specifying the value that the 
checkbox property must have for it to be considered selected already.


If you don't want to copy the permission data from your model into the 
form bean before rendering the form, you can do as previously suggested 
and put the entire business object into the form bean; that solution 
actually doesn't prevent the properties being written/updated. There are 
problems with this approach for certain types of inputs, but for boolean 
values rendered as checkboxes it should work fine.


L.

Anthony N. Frasso wrote:

I guess I don't follow

How do I prepopulate the form bean?  I have a list
page which lists all of the roles in the system.  When
the form on the list page is submitted, I can retrieve
the ID of the role that the user wants to edit.  In
the action class I then retrieve that role, and put it
into the request scope.

The question is... how do I pre-populate the form bean
with that role?  I don't have access to the form bean
yet from the action class.

Regards,
Anthony Frasso

--- Puneet Lakhina <[EMAIL PROTECTED]> wrote:


On 8/30/06, Anthony N. Frasso <[EMAIL PROTECTED]>
wrote:

Actually, that's incorrect.  I want to *read* from

the

Role bean.  I want to *write* to the form bean.  I
just don't know how to go about it yet. :)  It

seems

like I have to read/write to the same form bean,

which

doesn't make sense, because I don't have the form

bean

until I get to the JSP page, so there's no way to
initialize it.


Actually you have probably missed the total concept
of prepopulating. You
put initial values in you form beans, when your JSP
page loads your struts
tags call the getter methods of the relevant  to put
initial values in your
fields. And then when the form is submitted setter
methods are called
followed by validate(if present and the action has
set validate="true"), and
in case of no errors in validate the action methods
execute is called which
in turn returns a forward to a page.

so your cycle for a normal form submit is like this.

request for jsp->prepoulate using getter->jsp
rendered->submit->call
setters->validate->if no errors ->execute of
Action->forward

--
Puneet




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



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



Re: Dynamically Initializing Checkbox Value

2006-08-30 Thread Michael Jouravlev

On 8/30/06, Anthony N. Frasso <[EMAIL PROTECTED]> wrote:

I don't have the form bean
until I get to the JSP page, so there's no way to
initialize it.


Struts being a classic Model 2 framework requires all requests to go
through an action. Well, this is not a strict requirement just a
standard practice. You never request a page from the browser, you
always request an action. An action usually does some setup stuff like
loading data from database and sticking it into an ActionForm (or into
assorted objects spread all over requst and session scopes, ew!) and
forwards to JSP that displays that data.

http://wiki.apache.org/struts/StrutsCatalogLinkOnlyToActions
http://wiki.apache.org/struts/StrutsManualActionClasses

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz

David Durham wrote:

Tom Bednarz wrote:
I think the validator fires too early, but probably I am doing 
something wrong. Maybe somebody can hp!


Basically, you need 2 actions, one to populate the form and one to 
change the personal data.





David,

This is EXACTLY what I like to AVOID! With this concept I have to write 
dozends of useless action classes!


In my Action class I did:

public ActionForward execute(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
{
ActionForward af = null;
..

String operation = request.getParameter("operation");
.

if (operation != null &&
operation.compareToIgnoreCase("update") == 0)
{
. Perform update operation here
}
   else  // showData
   {
 Populate form here
   }
   return (new ActionForward("/showPersonalData.do"));
}

The surprising thing (at least for me...) is, that when running in the 
debugger, execute method is NEVER called (does not stop at any 
breakpoint) !!!


Is there no more intelligent way then creating lots of actions?? Maybe 
this is a motivation to move to JSF!!


Tom


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



Re: Dynamically Initializing Checkbox Value

2006-08-30 Thread Anthony N. Frasso
I guess I don't follow

How do I prepopulate the form bean?  I have a list
page which lists all of the roles in the system.  When
the form on the list page is submitted, I can retrieve
the ID of the role that the user wants to edit.  In
the action class I then retrieve that role, and put it
into the request scope.

The question is... how do I pre-populate the form bean
with that role?  I don't have access to the form bean
yet from the action class.

Regards,
Anthony Frasso

--- Puneet Lakhina <[EMAIL PROTECTED]> wrote:

> On 8/30/06, Anthony N. Frasso <[EMAIL PROTECTED]>
> wrote:
> >
> > Actually, that's incorrect.  I want to *read* from
> the
> > Role bean.  I want to *write* to the form bean.  I
> > just don't know how to go about it yet. :)  It
> seems
> > like I have to read/write to the same form bean,
> which
> > doesn't make sense, because I don't have the form
> bean
> > until I get to the JSP page, so there's no way to
> > initialize it.
> 
> 
> Actually you have probably missed the total concept
> of prepopulating. You
> put initial values in you form beans, when your JSP
> page loads your struts
> tags call the getter methods of the relevant  to put
> initial values in your
> fields. And then when the form is submitted setter
> methods are called
> followed by validate(if present and the action has
> set validate="true"), and
> in case of no errors in validate the action methods
> execute is called which
> in turn returns a forward to a page.
> 
> so your cycle for a normal form submit is like this.
> 
> request for jsp->prepoulate using getter->jsp
> rendered->submit->call
> setters->validate->if no errors ->execute of
> Action->forward
> 
> -- 
> Puneet
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread David Durham

Tom Bednarz wrote:
I think the validator fires too early, but probably I am doing something 
wrong. Maybe somebody can hp!


Basically, you need 2 actions, one to populate the form and one to 
change the personal data.






I have the following form bean defined in struts-config.xml:

type="org.apache.struts.validator.DynaValidatorActionForm" >














and the following action mapping:


  
  



The idea is, that I show a form that contains already data and the user 
can edit it. When the form is submitted, the validator should check the 
user input. Here is my validator configuration:




  

  
  

  
  

  
  

  
  

  
  

  
  


  


Now it seems, that the validator gets fired BEFORE the form is filled! 
In the JSP that displays the form, I get lots of error messages all 
fired by the 'required' validator saying, that the field must not be 
empty, but all fields are filled corretly!!.


Here is an extract of the JSP:


  

   


  


   

  
  

  


  


  

  
  ...

 

Every row contains a label, an input control and a TD to display 
validation errors of the specific field.


Does anybody know what is going wrong here??

Many thanks for your help!

Tom


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




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



validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz
I think the validator fires too early, but probably I am doing something 
wrong. Maybe somebody can hp!


I have the following form bean defined in struts-config.xml:

type="org.apache.struts.validator.DynaValidatorActionForm" >














and the following action mapping:


  
  



The idea is, that I show a form that contains already data and the user 
can edit it. When the form is submitted, the validator should check the 
user input. Here is my validator configuration:




  

  
  

  
  

  
  

  
  

  
  

  
  


  


Now it seems, that the validator gets fired BEFORE the form is filled! 
In the JSP that displays the form, I get lots of error messages all 
fired by the 'required' validator saying, that the field must not be 
empty, but all fields are filled corretly!!.


Here is an extract of the JSP:


  

   


  


   

  
  

  


  


  

  
  ...

 

Every row contains a label, an input control and a TD to display 
validation errors of the specific field.


Does anybody know what is going wrong here??

Many thanks for your help!

Tom


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



Re: Struts Book?

2006-08-30 Thread Simon Chappell

On 8/30/06, Ted Husted <[EMAIL PROTECTED]> wrote:

On 8/30/06, Simon Chappell <[EMAIL PROTECTED]> wrote:
> Is that an unofficial announcement of the 1.3 release date? :-)

There is already a 1.3.5 beta release pending.

* http://struts.apache.org/announce.html

How soon it goes GA depends on how soon people like Simon Chappell
take it for a spin with their own applications and let us know that it
works for them :)


You're gotta remember that I'm just a little tiny cog in a very big
machine. I don't have opportunity to download and test stuff out at
work.


We use the milestone release scheme, so if people tell us these bits
are joyful, then these are the bits that become the 1.3.5 GA release.
Could be this weekend, could be next month, or it could just remain a
beta. The PMC has done its part. How soon now depends on how soon the
rest of the community takes an active interest.


Understood. Unfortunately, I am seriously overcommitted at home as
well, so I can't even help you on my personal time where I can
download and install what I like. :-(

Simon

--
www.simonpeter.org

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



Re: Dynamically Initializing Checkbox Value

2006-08-30 Thread Albert L. Sapp

Anthony,

I am puzzled by your comment that you don't have a form bean before you 
get to the jsp.  We do this all the time.  Say I want to display a list 
of inventory items for a user.  I retrieve a list of inventory items 
matching the query data the user gave me and create an array of 
inventory item forms to pass to the jsp.  I convert information from the 
list inventory item beans and place each one into the array.  Then just 
set the array as a parameter in request scope and then use that 
parameter to build my jsp.


I do the same if I am providing a means for a user to update information 
on an item.  I initialize the form in the prep action, display the jsp 
and read the form in the processing action.  So I read/write to the same 
inventory item form bean and read/write to my DAO inventory item bean 
for the backend.  The only reason I use 2 different beans is it was 
mandated to separate the view from the model and I need to convert some 
data say the unit of issue ID to a actual unit of issue for the user.


I hope this helps.

Al

Anthony N. Frasso wrote:

Actually, that's incorrect.  I want to *read* from the
Role bean.  I want to *write* to the form bean.  I
just don't know how to go about it yet. :)  It seems
like I have to read/write to the same form bean, which
doesn't make sense, because I don't have the form bean
until I get to the JSP page, so there's no way to
initialize it.

Thanks for the help,
Anthony Frasso

--- Puneet Lakhina <[EMAIL PROTECTED]> wrote:

  

On 8/30/06, Anthony N. Frasso <[EMAIL PROTECTED]>
wrote:


Hello all,

public class Role {

private int id;
private String name;
private String description;

private boolean permissionA;
private boolean permissionB;
...
private boolean permissionN;
}

Each of those properties has getter and setter
methods.  By the way, in the *actual* Role class,
  

the


permission booleans are named such things as
"canAccessProjects" and "canEditCustomers" and
  

other


such actual permissions, which is why I am not
  

using


an array of booleans in this case.  I want to
  

refer to


them by name.

Now I wanted to create a JSP that contained a
  

form,


that allowed a user to edit a role.  Here is the
definition of my form bean (called EditRoleForm):

public class EditRoleForm extends ActionForm {

private boolean roleId;
private boolean roleName;
private boolean roleDescription;

private boolean rolePermissionA;
private boolean rolePermissionB;
...
private boolean rolePermissionN;
}
  

I kinda dont understand why do you need 2 beans as
long as u only care about
reading from them.
 you could have somehting like this in your form
bean
 public class EditRoleForm extends ActionForm {
Role role = new Role();
/*getter method*/
}
and then in your jsp you have



Permission A: 

you dont need to specify a value explicitly, it
loads the field with
whatever value the property has.

In this instance, the form bean looks quite similar
to


the role bean.

In my JSP, I have the following:


  

  Name:
  


  Description:


property="roleDescription"


  

value="${role.description}"


   />


  Permission A:


property="rolePermissionA"


 value="true" />


  Permission B:


property="rolePermissionB"


 value="true" />

...

  Permission N:


property="rolePermissionN"


 value="true" />


  
  
  


As you can see, all of the checkboxes are going to
  

be


initialized blank.  I would instead prefer them to
  

be


initialized with the value in the role within the
request scope.  I was able to do this using the
"value" parameter in the text and textarea tags,
  

but


the value parameter is used differently for the
checkbox tag.

I hope this clears it up.

One final note: After reading everyone's
  

responses,


and also reading around on the web, I seem to be
getting an idea that the name of the property in
  

the


Role bean and the Form bean should be identical,
  

and


this is the way it is able to initialize the value
  

in


the checkbox, and also set the correct value in
  

the


form bean when it is submitted.  This seems like a
  

bad


idea.  For one, how do we know that there is a
one-to-one mapping of beans to form beans?  If I'm
modifying a few beans all on the same JSP page, I
certainly don't want there to be confusion.

I hope I've made myself clear, and I look forward
  

to


everyone's response.  I really appreciate the time
  

and


effort everyone has taken in helping me out thus
  

far.


Regards,
Anthony Frasso

__

Re: [Tiles 2.0] Tiles Without Intermediate Pages WAS: [tiles] page content

2006-08-30 Thread Wendy Smoak

On 8/30/06, Antonio Petrelli <[EMAIL PROTECTED]> wrote:


P.S.: Should we use [Tiles 2.0] when referring to new Tiles? I asked
this because the site it is written to use [tiles] instead (anyway
[Tiles 2.0] is much clearer).


It's just a tag for those who want to filter on the subject line... I
would suggest [tiles2], but the person who changes the page gets to
decide. :)  The file is index.xml in
http://svn.apache.org/repos/asf/struts/sandbox/trunk/tiles/src/site/xdoc/
.

--
Wendy

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



Re: Struts Book?

2006-08-30 Thread Ted Husted

On 8/30/06, Simon Chappell <[EMAIL PROTECTED]> wrote:

Is that an unofficial announcement of the 1.3 release date? :-)


There is already a 1.3.5 beta release pending.

* http://struts.apache.org/announce.html

How soon it goes GA depends on how soon people like Simon Chappell
take it for a spin with their own applications and let us know that it
works for them :)

We use the milestone release scheme, so if people tell us these bits
are joyful, then these are the bits that become the 1.3.5 GA release.
Could be this weekend, could be next month, or it could just remain a
beta. The PMC has done its part. How soon now depends on how soon the
rest of the community takes an active interest.

-Ted.

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



Re: scriptlet not evaluated inside tag

2006-08-30 Thread Laurent Duparchy

I found that

onclick="this.value=${labelPrinterButton}" 


is working

Leon Rosenberg wrote:


hi,
try:
onclick="<%="this.value='"+labelPrinterButton+"'"%>'"

regards
Leon


On 8/29/06, Laurent Duparchy <[EMAIL PROTECTED]> wrote:


Hi,

I'm forced to use a scriptlet to insert a localized label into a tag.
The code is this ;
(Note : this code is changing a button display by an image, defined in
the css file. )








only the last two <%=labelPrinterButton%> scriptlet out of the three are
evaluated. The first one is not. This drive me nuts.
Of course, since the "this.value" is is not something displayed, I can
put in there any string. But I just wonder why the scriptlet in there is
not evaluated.

the result html page is :

onclick="this.value='<%=labelPrinterButton%>'" class="buttonPrinter" 
title="Printable version" alt="Printable version" type="submit">



OTOH, removing the "this.value" correct the problem, but this is not 
what I want





In that case the three scriptlets are correctly evaluated.


Thanks for your help.


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




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




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



Re: [Tiles 2.0] Tiles Without Intermediate Pages WAS: [tiles] page content

2006-08-30 Thread Antonio Petrelli

Greg Reddin ha scritto:


  Default Header Stuff

  Default Body Stuff

  Default Footer Stuff

Then you extend it with a page like this:



Extended/Overridden Body Content




It seems that  already accepts the body so it "potentially" 
could work (though it seems that Mehdi made a test and it doesn't work). 
Anyway the "default" part should be implemented.

It could be something like:


Default content


Or

defaultValue="/mydefault.jsp" defaultType="template" />


Antonio

P.S.: Should we use [Tiles 2.0] when referring to new Tiles? I asked 
this because the site it is written to use [tiles] instead (anyway 
[Tiles 2.0] is much clearer).



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



Re: Struts Book?

2006-08-30 Thread James Mitchell
Ha!  If Holmes can predict the future, I've got a few lottery tickets  
I'd like him to look over for me ;)



--
James Mitchell
678.910.8017




On Aug 30, 2006, at 11:00 AM, Simon Chappell wrote:


On 8/30/06, James Holmes <[EMAIL PROTECTED]> wrote:
Thanks for the vote of confidence Ted. A 2nd edition of my Struts:  
The Complete
Reference will be out at the end of the year that is up to date  
with Struts 1.3.


Is that an unofficial announcement of the 1.3 release date? :-)

Simon

--
www.simonpeter.org

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




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



Re: Session Timeout

2006-08-30 Thread John De Lello
I think I found the offending code. It is located in the Struts
RequestProcessor.processLocale method (which is called *before* the
pre-process). In that method is the following code:

// Has a Locale already been selected?
HttpSession session = request.getSession();

So I will *always* get a non-null session when I get control in the
processPreprocess method. 

There doesn't seem to be a hook before any processing is done.

John

-Original Message-
From: Ed Griebel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 30, 2006 9:53 AM
To: Struts Users Mailing List
Subject: Re: Session Timeout

[moving to struts-user list]
A new session is created when you request a new session somewhere,
it's not created automatically. However, there could be a filter,
request processor, action, or JSP  somewhere that does a
request.getSession() or .getSession(true) (or '... session="true"...'
in JSP), which all will create a session if none exists. If it's
buried deep enough in a chain of filters it could *appear* to be magic
:-)

There is a method isNew() on the session that you can check to see if
it's a new session that might help in your case.

-ed

On 8/30/06, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:
> hi,
>
>   I think a new session is created if you invoke an action mapping. this
code will not work. what you have to do is, add some attribute to the
session.. and check if that attribute is on the session. if not you can
redirect to your session timeout page.
>
>   Correct me if i am worng in here.
>
>   Thanks,
>
>   Nuwan
>
> John De Lello <[EMAIL PROTECTED]> wrote:
>   The mandate is no JS. I'd prefer to not use a filter either for this. I
was
> just wondering why I was getting a valid session when the session was
indeed
> expired.
>
>
> -Original Message-
> From: faisal abdallah [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 29, 2006 2:30 PM
> To: Struts Developers List; [EMAIL PROTECTED]
> Subject: RE: Session Timeout
>
> This can be done easily with javascript inside the main layout
> email me on [EMAIL PROTECTED] and I will send you the code
>
> skillipedia.com
>
> -Original Message-
> From: John De Lello [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 29, 2006 11:15 AM
> To: dev@struts.apache.org
> Subject: Session Timeout
>
> Hey Everyone,
>
> I am trying to use a custom session timeout JSP. To do this, I extended
> "RequestProcessor" and overrode "processPreprocess" and added the
following
> code:
>
> HttpSession sess = req.getSession(false);
>
> if(sess == null){
> // even when the session IS timed out, I never get here.
> String uri = "/myapp/sessiontimeout.jsp";
> try{
> doForward(uri, req, resp);
> }catch(Exception ex){}
>
> return false;
> }
>
> The problem is, even when I know the session was expired, I never get a
null
> session. Am I missing something?
>
> Thanks
> John
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> -
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great
rates starting at 1¢/min.
>

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






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






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



Multipart request

2006-08-30 Thread Raghuveer
What are best practices in using Multipart request for file uploads using
struts


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



Re: Struts Book?

2006-08-30 Thread Simon Chappell

On 8/30/06, James Holmes <[EMAIL PROTECTED]> wrote:

Thanks for the vote of confidence Ted. A 2nd edition of my Struts: The Complete
Reference will be out at the end of the year that is up to date with Struts 1.3.


Is that an unofficial announcement of the 1.3 release date? :-)

Simon

--
www.simonpeter.org

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



Re: [Tiles 2.0] Tiles Without Intermediate Pages WAS: [tiles] page content

2006-08-30 Thread Mehdi Bahribayli


Greg Reddin <[EMAIL PROTECTED]> wrote: One thing that has often bothered me 
about Tiles in a standalone web  
application is the need for a JSP page that "calls" a tiles  
definition.  Consider the following from the Tiles 2.0 test application:

tiles-defs.xml
   
   

   

   

   

   

   


In this case you have a tile called "doc.mainLayout".  In most cases  
you want to have a URL that pulls in the doc.mainLayout and replaces  
the "body" component with something else.  Right now you have to  
create an intermediate JSP page:

intermediate.jsp


   


If you're using Tiles with Struts you can use the forward mechanism  
to achieve this without the intermediate JSP page:

 

But you essentially have to do the intermediate page in tiles-defs.xml:

 
  

 


In JSF you have a similar issue.  I haven't used Tiles with JSF yet,  
but I think you could do the same thing you do with Struts.  You just  
use navigation-rules instead of action mappings.  I'm currently  
building an app using JSF and Facelets.  Facelets gets around the  
"intermediate" page by being sort of a "backwards" Tiles - or more  
precisely - an "inline" Tiles.  In Facelets you extend things  
inline.  Here's an example:

With Tiles you might have a template that does this:

 
   
 
   
 
   

In the above code your template invokes named "sections" that are  
defined in the tile definition.  You invoke the template and  
substitute values for the named section.

To do the same thing in Facelets you might have this:

 
   Default Header Stuff
 
   Default Body Stuff
 
   Default Footer Stuff

Then you extend it with a page like this:

 
  
   Extended/Overridden Body Content
  
 

JSF removes the intermediate step b/c the FacesServlet will always  
render a view - so if you hit the URL myapp/somepage.jsf you'll get  
forwarded to /somepage.xhtml which can invoke a template.  So you can  
see how Facelets sort of works backwards.  You define a page that  
extends a template and defines the extended portions inline.  If  
Facelets was supported in a standalone environment (i.e. without  
JSF)  you could possibly just invoke a *.xhtml URL and skip the  
intermediate step altogether.

It would be nice if we could make Tiles work this way.  Then you'd  
have a Facelets-like templating technology that is based on JSP and  
works the same in JSF, Struts, any other MVC framework in which it is  
supported, and standalone without any MVC framework whatsoever.

Thoughts?
Greg


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





Facelets is a good framework for JSF presentation. It follows JSF lifecycle 
(but JSP does not) but it has shortcommings yet. It is not as mature as JSP (no 
support for i18n, very restricted set of tags to name a few) but it will not 
remain so. I think it is a good idea to add "inline Tiles" feature to Tiles for 
now.


-
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small 
Business.

FormFile

2006-08-30 Thread Raghuveer

What is minimum requirement for file upload configuration in struts.

My ActionForm is in "session" scope in actionmapping.


What are precautions to configuring declaritively in struts-config.xml or in
action in order to avoid unwanted thread/IO stream hanging or some other
problems.

After file upload  and submit form latest data is not getting updated to
ActionForm.

What could be the problem and how to resolve such issues.


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



Re: [tiles] page content

2006-08-30 Thread Mehdi Bahribayli


Greg Reddin <[EMAIL PROTECTED]> wrote: 
On Aug 30, 2006, at 8:40 AM, Mehdi Bahribayli wrote:

> II. I think you have misunderstood what I wanted to say. I think  
> there is no need for /subviews/welcome.jspf because it is used just  
> once and there is no need to put the contenet in a separate file. I  
> think both /subviews/welcome.jspf and /views/welcome.jsp are one  
> and same thing and should be integrated into one file. (5 elements  
> instead of 6 elements)

Can you post the contents of these 2 files?  It's hard to know  
exactly what you are talking about without seeing that.

One thing that has often bothered me about Tiles in a standalone web  
application is the need for a JSP page that "calls" a tiles  
definition.  If I understand your original question it sounds like  
this is what is bothering you too.  Consider the following from the  
Tiles 2.0 test application:

tiles-defs.xml
   
   

   

   

   

   

   


In this case you have a tile called "doc.mainLayout".  In most cases  
you want to have a URL that pulls in the doc.mainLayout and replaces  
the "body" component with something else.  Right now you have to  
create an intermediate JSP page:

intermediate.jsp


   


Right now, I don't think there's a way around that problem, but it's  
perhaps a missing feature in Tiles that we will eventually correct.   
More discussion on that in a separate thread.

Greg



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





Yes, you get what I am talking about. So it is a missing feature of Tiles. Let 
us talk about it in the new thread that you opened.

Mehdi


-
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

Re: Struts Book?

2006-08-30 Thread James Holmes
Thanks for the vote of confidence Ted. A 2nd edition of my Struts: The Complete 
Reference will be out at the end of the year that is up to date with Struts 1.3.

Thanks,

James


On Wed Aug 30  8:23 , 'Ted Husted' <[EMAIL PROTECTED]> sent:

>Struts: The Complete Reference
>
>* http://opensource.atlassian.com/confluence/oss/display/BOOKS/ISBN-0072231319
>
>On 8/30/06, Pankaj Gupta [EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Can anyone suggest a good Struts book covering advanced Struts topics and
>> covering Struts 1.2.
>>
>> regards,
>> Pankaj
>>
>
>-- HTH, Ted.
>* http://www.husted.com/struts/
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>



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



Re: [tiles] page content

2006-08-30 Thread Mehdi Bahribayli


Antonio Petrelli <[EMAIL PROTECTED]> wrote: Mehdi Bahribayli ha scritto:
>> 
>>   
>> 
>>
>> 
> I. I have already tried that. I get an exception: 
> javax.servlet.jsp.JspException: Invalid attribute type: java.lang.String
>   

This could be possibly a bug, I will investigate it.

> II. I think you have misunderstood what I wanted to say. I think there is no 
> need for /subviews/welcome.jspf because it is used just once and there is no 
> need to put the contenet in a separate file. I think both 
> /subviews/welcome.jspf and /views/welcome.jsp are one and same thing and 
> should be integrated into one file. (5 elements instead of 6 elements)

Probably now I understood: you need something like:


  
  <%-- The code contained in /subviews/welcome-body.jspf --%>
  



Try it, I read the code and it seems that nothing prevents you from 
using it.

Ciao
Antonio

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

I used:


  
  <%-- The code contained in /subviews/welcome-body.jspf --%>
  


but I get:
javax.servlet.jsp.JspException: Invalid attribute type: java.lang.String
again. (no mater which 'type' attribute I use with 'put' and 'insert')



-
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail.

RE: Struts Book?

2006-08-30 Thread John De Lello
I recommend:

http://www.objectsource.com/ 

It's a free PDF book


-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 30, 2006 10:24 AM
To: Struts Users Mailing List
Subject: Re: Struts Book?

Struts: The Complete Reference

*
http://opensource.atlassian.com/confluence/oss/display/BOOKS/ISBN-0072231319

On 8/30/06, Pankaj Gupta <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Can anyone suggest a good Struts book covering advanced Struts topics and
> covering Struts 1.2.
>
> regards,
> Pankaj
>

-- HTH, Ted.
* http://www.husted.com/struts/

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






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



[s2] Simple Tag Question and

2006-08-30 Thread Mark Menard
Is this following possible?









If it isn't how do you change the value of something on the value stack once
you are either into a JSP or in a FreeMarker template?

I have been struggling with this for days now. I know it's got to be
something really really really stupidly simple, but I'm just not seeing it.
I've read WebWork in Action, read a lot of the component and view.jsp code.
I just don't understand how you use these tags to modify the value of
something on the stack.

Thanks,

Mark

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



RE: Session Timeout

2006-08-30 Thread John De Lello
I think I found the offending code. It is located in the Struts
RequestProcessor.processLocale method (which is called *before* the
pre-process). In that method is the following code:

// Has a Locale already been selected?
HttpSession session = request.getSession();

So I will *always* get a non-null session when I get control in the
processPreprocess method. 

There doesn't seem to be a hook before any processing is done.

John

-Original Message-
From: Ed Griebel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 30, 2006 9:53 AM
To: Struts Users Mailing List
Subject: Re: Session Timeout

[moving to struts-user list]
A new session is created when you request a new session somewhere,
it's not created automatically. However, there could be a filter,
request processor, action, or JSP  somewhere that does a
request.getSession() or .getSession(true) (or '... session="true"...'
in JSP), which all will create a session if none exists. If it's
buried deep enough in a chain of filters it could *appear* to be magic
:-)

There is a method isNew() on the session that you can check to see if
it's a new session that might help in your case.

-ed

On 8/30/06, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:
> hi,
>
>   I think a new session is created if you invoke an action mapping. this
code will not work. what you have to do is, add some attribute to the
session.. and check if that attribute is on the session. if not you can
redirect to your session timeout page.
>
>   Correct me if i am worng in here.
>
>   Thanks,
>
>   Nuwan
>
> John De Lello <[EMAIL PROTECTED]> wrote:
>   The mandate is no JS. I'd prefer to not use a filter either for this. I
was
> just wondering why I was getting a valid session when the session was
indeed
> expired.
>
>
> -Original Message-
> From: faisal abdallah [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 29, 2006 2:30 PM
> To: Struts Developers List; [EMAIL PROTECTED]
> Subject: RE: Session Timeout
>
> This can be done easily with javascript inside the main layout
> email me on [EMAIL PROTECTED] and I will send you the code
>
> skillipedia.com
>
> -Original Message-
> From: John De Lello [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 29, 2006 11:15 AM
> To: dev@struts.apache.org
> Subject: Session Timeout
>
> Hey Everyone,
>
> I am trying to use a custom session timeout JSP. To do this, I extended
> "RequestProcessor" and overrode "processPreprocess" and added the
following
> code:
>
> HttpSession sess = req.getSession(false);
>
> if(sess == null){
> // even when the session IS timed out, I never get here.
> String uri = "/myapp/sessiontimeout.jsp";
> try{
> doForward(uri, req, resp);
> }catch(Exception ex){}
>
> return false;
> }
>
> The problem is, even when I know the session was expired, I never get a
null
> session. Am I missing something?
>
> Thanks
> John
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> -
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great
rates starting at 1¢/min.
>

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






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



[Tiles 2.0] Tiles Without Intermediate Pages WAS: [tiles] page content

2006-08-30 Thread Greg Reddin
One thing that has often bothered me about Tiles in a standalone web  
application is the need for a JSP page that "calls" a tiles  
definition.  Consider the following from the Tiles 2.0 test application:


tiles-defs.xml
  
  
  
  
  
  
  

In this case you have a tile called "doc.mainLayout".  In most cases  
you want to have a URL that pulls in the doc.mainLayout and replaces  
the "body" component with something else.  Right now you have to  
create an intermediate JSP page:


intermediate.jsp


  


If you're using Tiles with Struts you can use the forward mechanism  
to achieve this without the intermediate JSP page:




But you essentially have to do the intermediate page in tiles-defs.xml:





In JSF you have a similar issue.  I haven't used Tiles with JSF yet,  
but I think you could do the same thing you do with Struts.  You just  
use navigation-rules instead of action mappings.  I'm currently  
building an app using JSF and Facelets.  Facelets gets around the  
"intermediate" page by being sort of a "backwards" Tiles - or more  
precisely - an "inline" Tiles.  In Facelets you extend things  
inline.  Here's an example:


With Tiles you might have a template that does this:


  

  

  

In the above code your template invokes named "sections" that are  
defined in the tile definition.  You invoke the template and  
substitute values for the named section.


To do the same thing in Facelets you might have this:


  Default Header Stuff

  Default Body Stuff

  Default Footer Stuff

Then you extend it with a page like this:



Extended/Overridden Body Content



JSF removes the intermediate step b/c the FacesServlet will always  
render a view - so if you hit the URL myapp/somepage.jsf you'll get  
forwarded to /somepage.xhtml which can invoke a template.  So you can  
see how Facelets sort of works backwards.  You define a page that  
extends a template and defines the extended portions inline.  If  
Facelets was supported in a standalone environment (i.e. without  
JSF)  you could possibly just invoke a *.xhtml URL and skip the  
intermediate step altogether.


It would be nice if we could make Tiles work this way.  Then you'd  
have a Facelets-like templating technology that is based on JSP and  
works the same in JSF, Struts, any other MVC framework in which it is  
supported, and standalone without any MVC framework whatsoever.


Thoughts?
Greg


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



Re: [tiles] page content

2006-08-30 Thread Greg Reddin


On Aug 30, 2006, at 8:40 AM, Mehdi Bahribayli wrote:

II. I think you have misunderstood what I wanted to say. I think  
there is no need for /subviews/welcome.jspf because it is used just  
once and there is no need to put the contenet in a separate file. I  
think both /subviews/welcome.jspf and /views/welcome.jsp are one  
and same thing and should be integrated into one file. (5 elements  
instead of 6 elements)


Can you post the contents of these 2 files?  It's hard to know  
exactly what you are talking about without seeing that.


One thing that has often bothered me about Tiles in a standalone web  
application is the need for a JSP page that "calls" a tiles  
definition.  If I understand your original question it sounds like  
this is what is bothering you too.  Consider the following from the  
Tiles 2.0 test application:


tiles-defs.xml
  
  
  
  
  
  
  

In this case you have a tile called "doc.mainLayout".  In most cases  
you want to have a URL that pulls in the doc.mainLayout and replaces  
the "body" component with something else.  Right now you have to  
create an intermediate JSP page:


intermediate.jsp


  


Right now, I don't think there's a way around that problem, but it's  
perhaps a missing feature in Tiles that we will eventually correct.   
More discussion on that in a separate thread.


Greg



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



Re: Struts Book?

2006-08-30 Thread Ted Husted

Struts: The Complete Reference

* http://opensource.atlassian.com/confluence/oss/display/BOOKS/ISBN-0072231319

On 8/30/06, Pankaj Gupta <[EMAIL PROTECTED]> wrote:

Hi,

Can anyone suggest a good Struts book covering advanced Struts topics and
covering Struts 1.2.

regards,
Pankaj



-- HTH, Ted.
* http://www.husted.com/struts/

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



File Upload Causing page expire

2006-08-30 Thread Raghuveer


I have useed struts1.2 file upload in many projects for many times.It worked
well perfectly.

But in my current project struts1.2.8

After uploading file ,I am showing data in jsp by nested tags.

When clicked any of the action in JSP latest data is not set to ACTIONFORM.


to be simple,

Data is not set to actionform after file uplod.
some times page is getting expired

What could be the reason ?


 


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



Re: Best practice for external webapp configuration ?

2006-08-30 Thread Nicolas De Loof


Thanks for this info,

I'm targeting Tomcat 4 (for developpers) and Websphere 5 (for production)

Nico.


Lance a écrit :

On jboss, this can be done by configuring the SystemPropertiesService.
@see jboss\server\all\deploy\properties-service.xml

Properties can be configured inline in the xml file or can be declared in a
separate file which is referenced by properties-service.xml.

  

Hello,

I'm searching for best practice in JEE applications to put 
configuration elements outside the war/ear.


Here is what I mean : My webapp requires some filesystem path to work 
(logs dir, system-dependent config files...). I'm using a java sytem 
property to setup a root path for external configuration, but this 
requires to customize the container JVM ("-Dxxx=yyy"). Is there a 
better "JEE" way to do such things ?


Nico.






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

  


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



RE: Best practice for external webapp configuration ?

2006-08-30 Thread Lance
On jboss, this can be done by configuring the SystemPropertiesService.
@see jboss\server\all\deploy\properties-service.xml

Properties can be configured inline in the xml file or can be declared in a
separate file which is referenced by properties-service.xml.

> Hello,
>
> I'm searching for best practice in JEE applications to put 
> configuration elements outside the war/ear.
>
> Here is what I mean : My webapp requires some filesystem path to work 
> (logs dir, system-dependent config files...). I'm using a java sytem 
> property to setup a root path for external configuration, but this 
> requires to customize the container JVM ("-Dxxx=yyy"). Is there a 
> better "JEE" way to do such things ?
>
> Nico.




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



Re: [tiles] page content

2006-08-30 Thread Antonio Petrelli

Mehdi Bahribayli ha scritto:


  



I. I have already tried that. I get an exception: 
javax.servlet.jsp.JspException: Invalid attribute type: java.lang.String
  


This could be possibly a bug, I will investigate it.


II. I think you have misunderstood what I wanted to say. I think there is no 
need for /subviews/welcome.jspf because it is used just once and there is no 
need to put the contenet in a separate file. I think both 
/subviews/welcome.jspf and /views/welcome.jsp are one and same thing and should 
be integrated into one file. (5 elements instead of 6 elements)


Probably now I understood: you need something like:


 
 <%-- The code contained in /subviews/welcome-body.jspf --%>
 



Try it, I read the code and it seems that nothing prevents you from 
using it.


Ciao
Antonio

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



Re: Session Timeout

2006-08-30 Thread Ed Griebel

[moving to struts-user list]
A new session is created when you request a new session somewhere,
it's not created automatically. However, there could be a filter,
request processor, action, or JSP  somewhere that does a
request.getSession() or .getSession(true) (or '... session="true"...'
in JSP), which all will create a session if none exists. If it's
buried deep enough in a chain of filters it could *appear* to be magic
:-)

There is a method isNew() on the session that you can check to see if
it's a new session that might help in your case.

-ed

On 8/30/06, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:

hi,

  I think a new session is created if you invoke an action mapping. this code 
will not work. what you have to do is, add some attribute to the session.. and 
check if that attribute is on the session. if not you can redirect to your 
session timeout page.

  Correct me if i am worng in here.

  Thanks,

  Nuwan

John De Lello <[EMAIL PROTECTED]> wrote:
  The mandate is no JS. I'd prefer to not use a filter either for this. I was
just wondering why I was getting a valid session when the session was indeed
expired.


-Original Message-
From: faisal abdallah [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 2:30 PM
To: Struts Developers List; [EMAIL PROTECTED]
Subject: RE: Session Timeout

This can be done easily with javascript inside the main layout
email me on [EMAIL PROTECTED] and I will send you the code

skillipedia.com

-Original Message-
From: John De Lello [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 11:15 AM
To: dev@struts.apache.org
Subject: Session Timeout

Hey Everyone,

I am trying to use a custom session timeout JSP. To do this, I extended
"RequestProcessor" and overrode "processPreprocess" and added the following
code:

HttpSession sess = req.getSession(false);

if(sess == null){
// even when the session IS timed out, I never get here.
String uri = "/myapp/sessiontimeout.jsp";
try{
doForward(uri, req, resp);
}catch(Exception ex){}

return false;
}

The problem is, even when I know the session was expired, I never get a null
session. Am I missing something?

Thanks
John




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




-
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates 
starting at 1¢/min.



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



Re: [tiles] page content

2006-08-30 Thread Mehdi Bahribayli

> I think (but I didn't try) that you can do, in welcome.jsp:
>
> 
>   
> 
>
> The attribute "body" will be filled only in a specific request.
> Let me know if it works.
>
> Ciao
> Antonio
I. I have already tried that. I get an exception: 
javax.servlet.jsp.JspException: Invalid attribute type: java.lang.String

II. I think you have misunderstood what I wanted to say. I think there is no 
need for /subviews/welcome.jspf because it is used just once and there is no 
need to put the contenet in a separate file. I think both 
/subviews/welcome.jspf and /views/welcome.jsp are one and same thing and should 
be integrated into one file. (5 elements instead of 6 elements)

Sincerely
Mehdi

  

-
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail.

Re: Come back to same JSP

2006-08-30 Thread Martin Gainty
Eric --
I would also check out
http://MachineName:Port/struts-examples/exercise/welcome.do
for some good examples,

(link courtesy of wendy smoak)
Thanks,
Martin --
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.




Your best bet would be to read some of the tutorials here:  
http://www.learntechnology.net/
The Struts CRUD lesson or the Struts iBATIS Lesson 1 would be helpful.


-Original Message-
From: Maya menon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 11:45 AM
To: user@struts.apache.org
Subject: Come back to same JSP


All,
   
  I have a jsp page, to add new records to the database. Now, when the records 
are added succesfully I have to come back to the same page with the fields 
populated with the added values.
   
  how do i achieve this ?
   
  Please let me know.
   
  Thanks


  
-
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small 
Business.

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



Re: [tiles] page content

2006-08-30 Thread Antonio Petrelli

Mehdi Bahribayli ha scritto:

* Use a fixed length font to see this message in correct layout.

In order to create a layout like this, I use six elements.

+---+
|Header |
+--++
 |  ||
|  ||
| Menu |  Body  |
|  ||
|  ||
|  ||
+--++
 |Body   |
+---+
 
1. A definition in tiles-def.xml :

...


 



...
 2. A page at /subviews/header.jspf (header).
 3. A page at /subviews/footer.jspf (footer).
 4. A page at /layouts/master.jsp. (layout).
5. A page at /views/welcome.jsp (page).
6. A page at /subviews/welcome-body.jspf(body).

You can see that all of the above mentioned elements can be used over and over 
but 6th element (the body) will be used just once as body of a specific page 
(5th element). Thus there is no need to define it as a separate tile. So how 
can I integrate 5th and 6th element?
  


I think (but I didn't try) that you can do, in welcome.jsp:


 


The attribute "body" will be filled only in a specific request.
Let me know if it works.

Ciao
Antonio


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



[tiles] page content

2006-08-30 Thread Mehdi Bahribayli
* Use a fixed length font to see this message in correct layout.

In order to create a layout like this, I use six elements.

+---+
|Header |
+--++
 |  ||
|  ||
| Menu |  Body  |
|  ||
|  ||
|  ||
+--++
 |Body   |
+---+
 
1. A definition in tiles-def.xml :
...


 


...
 2. A page at /subviews/header.jspf (header).
 3. A page at /subviews/footer.jspf (footer).
 4. A page at /layouts/master.jsp. (layout).
5. A page at /views/welcome.jsp (page).
6. A page at /subviews/welcome-body.jspf(body).

You can see that all of the above mentioned elements can be used over and over 
but 6th element (the body) will be used just once as body of a specific page 
(5th element). Thus there is no need to define it as a separate tile. So how 
can I integrate 5th and 6th element?

 
 
 

-
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small 
Business.

Reg : Exception Handling

2006-08-30 Thread Karthikn
Hi,

I am new user. I am implementing exception handling in my
application.

 

In my action class I have try, catch block.

 

in the catch block

 

catch(Exception e)

  {

return mapping,findforward("failure");

}

 

I defined the failure forward in my struts-config.xml.

 

 

But the problem is that forward is not getting executed.

 

 

Can u please help on this.

 

Thank you,

karthik



Re: Dynamically Initializing Checkbox Value

2006-08-30 Thread Anthony N. Frasso
Actually, that's incorrect.  I want to *read* from the
Role bean.  I want to *write* to the form bean.  I
just don't know how to go about it yet. :)  It seems
like I have to read/write to the same form bean, which
doesn't make sense, because I don't have the form bean
until I get to the JSP page, so there's no way to
initialize it.

Thanks for the help,
Anthony Frasso

--- Puneet Lakhina <[EMAIL PROTECTED]> wrote:

> On 8/30/06, Anthony N. Frasso <[EMAIL PROTECTED]>
> wrote:
> >
> > Hello all,
> >
> > public class Role {
> >
> > private int id;
> > private String name;
> > private String description;
> >
> > private boolean permissionA;
> > private boolean permissionB;
> > ...
> > private boolean permissionN;
> > }
> >
> > Each of those properties has getter and setter
> > methods.  By the way, in the *actual* Role class,
> the
> > permission booleans are named such things as
> > "canAccessProjects" and "canEditCustomers" and
> other
> > such actual permissions, which is why I am not
> using
> > an array of booleans in this case.  I want to
> refer to
> > them by name.
> >
> > Now I wanted to create a JSP that contained a
> form,
> > that allowed a user to edit a role.  Here is the
> > definition of my form bean (called EditRoleForm):
> >
> > public class EditRoleForm extends ActionForm {
> >
> > private boolean roleId;
> > private boolean roleName;
> > private boolean roleDescription;
> >
> > private boolean rolePermissionA;
> > private boolean rolePermissionB;
> > ...
> > private boolean rolePermissionN;
> > }
> 
> 
> I kinda dont understand why do you need 2 beans as
> long as u only care about
> reading from them.
>  you could have somehting like this in your form
> bean
>  public class EditRoleForm extends ActionForm {
> Role role = new Role();
> /*getter method*/
> }
> and then in your jsp you have
> 
> 
> 
> Permission A:  property="role.permissionA" />
> 
> you dont need to specify a value explicitly, it
> loads the field with
> whatever value the property has.
> 
> In this instance, the form bean looks quite similar
> to
> > the role bean.
> >
> > In my JSP, I have the following:
> >
> > 
> >   
> > 
> >   Name:
> >>  value="${role.name}" />
> > 
> > 
> >   Description:
> >property="roleDescription"
> > 
> value="${role.description}"
> >/>
> > 
> > 
> >   Permission A:
> >property="rolePermissionA"
> >  value="true" />
> > 
> > 
> >   Permission B:
> >property="rolePermissionB"
> >  value="true" />
> > 
> > ...
> > 
> >   Permission N:
> >property="rolePermissionN"
> >  value="true" />
> > 
> > 
> >   
> >   
> >   
> > 
> >
> > As you can see, all of the checkboxes are going to
> be
> > initialized blank.  I would instead prefer them to
> be
> > initialized with the value in the role within the
> > request scope.  I was able to do this using the
> > "value" parameter in the text and textarea tags,
> but
> > the value parameter is used differently for the
> > checkbox tag.
> >
> > I hope this clears it up.
> >
> > One final note: After reading everyone's
> responses,
> > and also reading around on the web, I seem to be
> > getting an idea that the name of the property in
> the
> > Role bean and the Form bean should be identical,
> and
> > this is the way it is able to initialize the value
> in
> > the checkbox, and also set the correct value in
> the
> > form bean when it is submitted.  This seems like a
> bad
> > idea.  For one, how do we know that there is a
> > one-to-one mapping of beans to form beans?  If I'm
> > modifying a few beans all on the same JSP page, I
> > certainly don't want there to be confusion.
> >
> > I hope I've made myself clear, and I look forward
> to
> > everyone's response.  I really appreciate the time
> and
> > effort everyone has taken in helping me out thus
> far.
> >
> > Regards,
> > Anthony Frasso
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> Puneet
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Come back to same JSP

2006-08-30 Thread Givler, Eric
Your best bet would be to read some of the tutorials here:  
http://www.learntechnology.net/
The Struts CRUD lesson or the Struts iBATIS Lesson 1 would be helpful.


-Original Message-
From: Maya menon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 11:45 AM
To: user@struts.apache.org
Subject: Come back to same JSP


All,
   
  I have a jsp page, to add new records to the database. Now, when the records 
are added succesfully I have to come back to the same page with the fields 
populated with the added values.
   
  how do i achieve this ?
   
  Please let me know.
   
  Thanks



-
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small 
Business.

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



Struts Book?

2006-08-30 Thread Pankaj Gupta
Hi, 

Can anyone suggest a good Struts book covering advanced Struts topics and 
covering Struts 1.2.

regards,
Pankaj

Re: Struts 1.2.9 - build failed

2006-08-30 Thread James Mitchell
The 1.2.x nightly builds are running just fine.  I don't know how  
you're kicking off Ant, but here's what the nightly script does:


$ ant download-dependencies nightly


--
James Mitchell
678.910.8017




On Aug 30, 2006, at 1:01 AM, Laurie Harper wrote:

Darren, the examples serve as documentation to help you see how to  
use various features of Struts; you can skip building them and  
still end up with a fully functional framework. I don't know why  
the build isnt' working correctly for you, but perhaps that's  
enough to allow you to move forward.


L.

Darren Hall wrote:

Update:
I found out why the struts.home property is not holding a value.  
It is
previously defined in the build.properties file used by the build  
process.
Apparently, properties defined in the build.properties file are  
not mutable?
In any case, is there a point to me attempting to compile these  
examples, or
are they not in any way beneficial, other than simply as examples?  
In other
words, do they add any functionality, or can I remove the calls to  
compile

these from the master build.xml file?
Thanks,
Darren
-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] Sent: Tuesday, August  
29, 2006 4:38 PM

To: 'Struts Users Mailing List'
Subject: Struts 1.2.9 - build failed
I am attempting to build struts 1.2.9 and having issues. It seems  
to build
the main struts.jar fine, but fails later in the process when  
building

mailreader.
I guess I have two questions. First, is there any value in  
building the struts-examples? Do they provide

any functionality to the framework?
 Second, if I do want to build the examples, why is the  
environment not

keeping the struts.home property?
The struts.home property in the struts-1.2.9/src/struts-examples/ 
mailreader

folder is not being set correctly (or being overwritten).

From the build.xml file, the struts home is set on line 36 as  
follows,

where
the basedir is specified as "."
 34>   
35>   
Group/Tomcat 5.5"/>
36>   
 Later when the build process runs, the value of struts.home is  
echoed to the

command line.
The value that is displayed is "/../../"
 I have tried manually overwriting the struts.home variable bu  
changing line

36 in the build.xml file to read
 
 But when the build executes, I still see the value of struts.home  
displayed

as "/../../".
 Has anyone run across this before, or does anyone have an idea  
why this

might be occurring?
 (Of course, if I don't need the examples, ignore question 2.)
 Thanks,
 Darren



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




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



Re: Dynamically Initializing Checkbox Value

2006-08-30 Thread Puneet Lakhina

On 8/30/06, Anthony N. Frasso <[EMAIL PROTECTED]> wrote:


Hello all,

public class Role {

private int id;
private String name;
private String description;

private boolean permissionA;
private boolean permissionB;
...
private boolean permissionN;
}

Each of those properties has getter and setter
methods.  By the way, in the *actual* Role class, the
permission booleans are named such things as
"canAccessProjects" and "canEditCustomers" and other
such actual permissions, which is why I am not using
an array of booleans in this case.  I want to refer to
them by name.

Now I wanted to create a JSP that contained a form,
that allowed a user to edit a role.  Here is the
definition of my form bean (called EditRoleForm):

public class EditRoleForm extends ActionForm {

private boolean roleId;
private boolean roleName;
private boolean roleDescription;

private boolean rolePermissionA;
private boolean rolePermissionB;
...
private boolean rolePermissionN;
}



I kinda dont understand why do you need 2 beans as long as u only care about
reading from them.
you could have somehting like this in your form bean
public class EditRoleForm extends ActionForm {
Role role = new Role();
/*getter method*/
}
and then in your jsp you have



Permission A: 

you dont need to specify a value explicitly, it loads the field with
whatever value the property has.

In this instance, the form bean looks quite similar to

the role bean.

In my JSP, I have the following:


  

  Name:
  


  Description:
  


  Permission A:
  


  Permission B:
  

...

  Permission N:
  


  
  
  


As you can see, all of the checkboxes are going to be
initialized blank.  I would instead prefer them to be
initialized with the value in the role within the
request scope.  I was able to do this using the
"value" parameter in the text and textarea tags, but
the value parameter is used differently for the
checkbox tag.

I hope this clears it up.

One final note: After reading everyone's responses,
and also reading around on the web, I seem to be
getting an idea that the name of the property in the
Role bean and the Form bean should be identical, and
this is the way it is able to initialize the value in
the checkbox, and also set the correct value in the
form bean when it is submitted.  This seems like a bad
idea.  For one, how do we know that there is a
one-to-one mapping of beans to form beans?  If I'm
modifying a few beans all on the same JSP page, I
certainly don't want there to be confusion.

I hope I've made myself clear, and I look forward to
everyone's response.  I really appreciate the time and
effort everyone has taken in helping me out thus far.

Regards,
Anthony Frasso

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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





--
Puneet


Re: Best practice for external webapp configuration ?

2006-08-30 Thread Nicolas De Loof


You didn't understand my problem :
My configuration requires a path that is system dependent. I cannot 
include this info in my WAR. I need to set it on the production server.


I'm using a single system property that gives me a filesystem path (or 
URL) and get it in my app to setup application properties that are 
system dependent. But this require to change the appserver JVM 
configuration and I cannot deploy my webapp twice on the same server 
with different configs (for example to deploy version N and N+1).


What would be the "JEE way" to do this ?

Kalra, Ashwani a écrit :

You can set them in your startup class by reading the configuration
file. 
System.setProperty()


/Ashwani
 


-Original Message-
From: Nicolas De Loof [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 30, 2006 1:08 PM

To: Struts Users Mailing List
Subject: Best practice for external webapp configuration ?


Hello,

I'm searching for best practice in JEE applications to put configuration
elements outside the war/ear.

Here is what I mean : My webapp requires some filesystem path to work
(logs dir, system-dependent config files...). I'm using a java sytem
property to setup a root path for external configuration, but this
requires to customize the container JVM ("-Dxxx=yyy"). Is there a better
"JEE" way to do such things ?

Nico.



This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message.


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


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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


  


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Re: Best way to secure struts-webapps?

2006-08-30 Thread Antonio Petrelli

Thomas Hamacher ha scritto:
But as far 
as I read in the internet, there is no good solution to use container managed 
security together with tiles. So if I wanna have a login-box on every page, 
that redirects dynamically to the same page after login I will have some 
trouble with the container managed solution. Is this not true or did I 
misunderstood anything? 
  


In the case of Tiles, if your needs are "I need different page 
appearence for different roles" then you might be interested in Dimensions.

http://mutidimensions.sf.net/

Ciao
Antonio


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



RE: Best practice for external webapp configuration ?

2006-08-30 Thread Kalra, Ashwani

You can set them in your startup class by reading the configuration
file. 
System.setProperty()

/Ashwani
 

-Original Message-
From: Nicolas De Loof [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 30, 2006 1:08 PM
To: Struts Users Mailing List
Subject: Best practice for external webapp configuration ?


Hello,

I'm searching for best practice in JEE applications to put configuration
elements outside the war/ear.

Here is what I mean : My webapp requires some filesystem path to work
(logs dir, system-dependent config files...). I'm using a java sytem
property to setup a root path for external configuration, but this
requires to customize the container JVM ("-Dxxx=yyy"). Is there a better
"JEE" way to do such things ?

Nico.



This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message.


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


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Re: Best way to secure struts-webapps?

2006-08-30 Thread Thomas Hamacher
Laurie,

thanks for the input. I am aware of the container managed security. But as far 
as I read in the internet, there is no good solution to use container managed 
security together with tiles. So if I wanna have a login-box on every page, 
that redirects dynamically to the same page after login I will have some 
trouble with the container managed solution. Is this not true or did I 
misunderstood anything? 

And another question to the filter-based solution as Leon also recommended: 
Does this also work if I have different tiles for one page and some of them 
are secured and some aren´t? E.g. I have a tile for an adminMenu, which is 
only loaded if I have a user with admin-roles in the session, but which is 
part of a usual public tiles-page? This way the servlet-filter will never 
find it´s pattern, will it? Is there a simple -Tag combined 
with an entry "role" in the action mapping and role-security-check in the 
RequestProcessor enough security to be sure, only admins access these 
actions? Or is there a way to get around these security-checks, which I 
should keep in mind?

Thank you very much

Thomas


Am Dienstag, 29. August 2006 22:01 schrieb Laurie Harper:
> You left container managed security off your list; that's the most
> 'standard' solution, but isn't necessarily the most portable since parts
> are container implementation defined. A filter is probably the most
> flexible alternative if container managed security isn't viable, but it
> really depends on your exact security requirements.
>
> This is a topic that's discussed alot, both here on the Struts lists,
> and in other web development forums, so I'd recommend doing some reading
> to get a feel for the solutions others have used and their tradeoffs.
>
> L.
>
> Thomas Hamacher wrote:
> > Hi everyone,
> >
> > I think I have a very basic question here, but after spending some time
> > with google I haven´t found a real solution to this question: What is the
> > best way to secure a struts webapplication to be sure, that only logged
> > in users are allowed to do some special action and access some special
> > pages?
> >
> > I found 3 possibilities, from what some of them seem to be a solution
> > from older struts versions.
> >
> > - Extend the RequestProcessor and do a programmatic security-check
> > - Use a Filter to do the security check
> > - Extend all Actions from a customized BaseAction, that does the security
> > check.
> >
> > But all of this seems a bit strange to me. As security is a
> > standard-problem in every webapplication and there are a lot of people
> > who thought about solutions (JAAS) I can´t believe, that I have to extend
> > the struts-framework myself to provide some security issues.
> >
> > So what would you recommend if you want to do a real secure application
> > with struts, together with tiles and want to be sure, that no pages or
> > actions are used without permission? And all of this independent, if I
> > use a Tomcat, a Resin or maybe a JBoss as my struts-web-server.
> >
> > Do you have any informations, examples or URL´s who have a real solution
> > to this?
> >
> > THank you very much
> >
> > Thomas
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Mit freundlichen Grüßen

Thomas Hamacher

- 
Thomas Hamacher
QualiGO GmbH
Bleicherstrasse 20
D-78467 Konstanz
Germany

fon:  +49-(0)7531-89207-0
fax:  +49-(0)7531-89207-13
mail: [EMAIL PROTECTED]
www:  www.qualigo.de

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



Best practice for external webapp configuration ?

2006-08-30 Thread Nicolas De Loof


Hello,

I'm searching for best practice in JEE applications to put configuration 
elements outside the war/ear.


Here is what I mean : My webapp requires some filesystem path to work 
(logs dir, system-dependent config files...). I'm using a java sytem 
property to setup a root path for external configuration, but this 
requires to customize the container JVM ("-Dxxx=yyy"). Is there a better 
"JEE" way to do such things ?


Nico.



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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