RE: Struts Validator and Select boxes

2004-03-26 Thread Janarthan Sathiamurthy
Hi Niall,

I am attaching the validation.xml and the jsp that i have used.
I have done the exact thing that you had specified earlier before posting
to the mailing list.
I am not clear where i am going wrong.

The Struts-config entry goes like - 














Regards,
Janarthan S

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 8:55 PM
To: Struts Users Mailing List
Subject: Re: Struts Validator and Select boxes


Posting whats in your validation.xml for the form and the bit of your jsp
with your select fields would be helpfull.

If you take the "fromDay" as an example, you are using
field.getVarValue("fromDay")  - if you don't have a "var" defined in your
validation.xml for "fromDay" then that would cause the "No Name Specified"
error - same goes for "fromYear", "toMonth", "toDay" and "toYear".

As for getting nulls, looks to me again that whats specified for the "vars"
in your validation.xml doesn't tie up with the names specified on your form.

>From your code I would expect something like the following in your
validation.xml



fromDay
  formFromDay

fromYear
  formFromYear

toMonth
  formToMonth

toDay
  formToDay

toYear
  formToYear




Do you have the properties in your form correct (i.e in this example
formFromDay, formFromYear, formToMonth, formToDay, formToYear).

Niall


- Original Message - 
From: "Janarthan Sathiamurthy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 25, 2004 4:46 PM
Subject: Struts Validator and Select boxes


Hi,

I am using Struts validator.
One page of mine has dates displayed as "MM"  "DD" "".
All the above 3 are displayed in seprate combo/select boxes.
I need to do some custom validations on these fields.
I wrote a custom class for the same
Looks like -
   public static boolean validateDates(Object bean,
ValidatorAction validatorAction,
Field field, ActionErrors errors,
HttpServletRequest request)
   {
  String actionType = ValidatorUtil.getValueAsString(bean,

field.getVarValue("actionType")); // A hidden form field
  String fromMonth = ValidatorUtil.getValueAsString(bean,

field.getProperty());
  String fromDay = ValidatorUtil.getValueAsString(bean,

field.getVarValue("fromDay"));
  String fromYear = ValidatorUtil.getValueAsString(bean,

field.getVarValue("fromYear"));
  String toMonth = ValidatorUtil.getValueAsString(bean,

field.getVarValue("toMonth"));
  String toDay = ValidatorUtil.getValueAsString(bean,

field.getVarValue("toDay"));
  String toYear = ValidatorUtil.getValueAsString(bean,

field.getVarValue("toYear"));

  System.out.println("actionType " + actionType);
  System.out.println("fromMonth " + fromMonth);
  System.out.println("fromDay " + fromDay);
  System.out.println("fromYear " + fromYear);
  System.out.println("toMonth " + toMonth);
  System.out.println("toDay " + toDay);
  System.out.println("toYear " + toYear);

  return true;
   }

O/P of the above code -
actionType searchPage
fromMonth 2
fromDay null
fromYear null
toMonth null
toDay null
toYear null

It also gives me "No Name Specified error".
Point to note is that the all other fields other than 'actionType' are
select boxes. It gives a null for all the field types that are of
html:select.
Is this a known BUG or am i going wrong somewhere ?


Error LOG -
Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil
getValueAsString
SEVERE: No name specified
java.lang.IllegalArgumentException: No name specified
at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j
ava:721)
at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80
1)
at
org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.ja
va:121)
at
com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDa
teValidator.j
ava:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39

RE: Help on struts

2004-03-26 Thread Shoaib
Thanks for your guidance.
You are right , we are in the case where user will come back from search
page.
I will try as you suggested and give feedback.
 
Regards
Shoaib
 
 
 
I guess the first thing to consider is what you mean by "come back to
the
previous page".
Do you just mean have the user redirected back to that url when they
have
finished playing with the search? or is it more complex. For example the
previous page is a form, and they are halfway through filling it in when
they need to search, and on completion need to take up where they left
off
with filling it in?
 
In the first case the easiest way (Im assuming there are multiple places
that send you to the search page) might be to have the link to the
search
page add a parameter to the url containing the name of an ActionForward
that
will take the user back to this page.
 
The search page can make note of this forward name, and when the user is
finished searching can look it up and return it as the forward from the
searchs action.
 
-Original Message-
From: Shoaib [mailto:[EMAIL   PROTECTED]
Sent: Saturday, 13 March 2004 14:01
To: 'Struts Users Mailing List'
Subject: Help on struts
 
 
We are using struts 1.1.
 
We have some pages where user is going to have some search icon and if
user clicks on that then he will move to search page where he can search
the value and then come back to the previous page.
 
Can somebody please give some idea how to do it.
 
Regards
Shoaib
 


Re: Dynamic forward in tiles

2004-03-26 Thread Pedro Salgado
On 25/03/2004 13:22, "Mariano García" <[EMAIL PROTECTED]>
wrote:

> El mié, 24-03-2004 a las 20:21, Pedro Salgado escribió:
>>   Below is a reply sent to this mailing list about something very similar to
>> what you are looking for.
> 
> but there is any way to use dynamic content only using tiles tags? In my
> case, I have a 'setAttribute("serverLocation", Location)' function in an
> Action in order to store a bean with a location information.
> 
> Location is a string (an url), so I want to use this url into a tile
> definition, like this:
> 
>  extends="tracebox.def.menu">
> 
> 
> 
> 
> I think it must be a "easy" solution, using tile tags.
> 

  The way I presented to you is the cleaner one :)

  If you define the put declaration in Tiles it will always be static (at
least for what I understood and read so far).

  If you want to make a tiles attribute dynamic, you must specify and
implement the tiles controller (described in the other mail).

  The not so "clean" solution is to use a tiles template with a  inside.

> what do you think?

  I guess this is not a question of what I think... It is more of how it
works :)
  This could be a nice feature to Tiles though.

  One could implement a Tiles controller that made this possible. You just
needed to parse all of attributes for ${scope.Attribute} values => it would
be inneficient most of the attributes are static. If the put declaration had
a dynamic attribute (true/false) it would certainly much more
interesting/efficient. Maybe I will try and do this on my weekend ;)



Pedro Salgado
  



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



Re: help with modules

2004-03-26 Thread James Norman
Try adding contextRelative="true" to the forwards in your
struts-config.  I remember a similar problem I had a while back, but I'm
not entirely sure this will solve it.  Here is an example of an Action I
had in a struts module I wrote:





-james
 
On Fri, 2004-03-26 at 10:08, Bruce Christie wrote:
> Hello,
> 
> I am playing around with modules and things work pretty nicely =
> except
> 
> I have a tiles template that reads in a menu.jsp from the default =
> WEB-INF.  The links to the actions are prepended with the module. (i.e. =
> . )
> 
> This works fine expect that once I am in the correct module the link =
> then points to  module1/module1/dosomething.do.  Is there a way that the =
> link tag can be used so that it will drop the module prefix when I am in =
> the module asscoiated with the action?
> 
> I think I read something about adding a module @ to the link tag but DTD =
> complains.
> 
> Thanks
> Bruce
> 
> -
> 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: [OT] "SELECT ... LIKE" with iBatis

2004-03-26 Thread Andy Engle
Ronald Rotteveel <[EMAIL PROTECTED]> wrote:

> Hi Andy,
> 
> we have a same kind of statement in our xml file and it looks like
> this:
>
> 
>  SELECT * FROM tbl_name WHERE column_name LIKE '%';
> 

Right, but I was running into trouble with where to put my #value#. 
Did you have anything like that in there?  I tried stuff like
'%#value#%', %#value#%, and whatever else but it didn't seem to want to
do anything but sit there and look at me.


Andy


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



RE: newbie html-el question

2004-03-26 Thread Wendy Smoak
> From: Bender, James [mailto:[EMAIL PROTECTED] 
> The user can click
> Search Attributes | Search Components | Search Templates
> I've provided html:link's like these respectively:
> doPrepareSearch.do?searchType=attribute |
> doPrepareSearch.do?searchType=component |
> doPrepareSearch.do?searchType=template

When the user clicks one of those, Struts will populate the form
associated with (I assume) PrepareSearchAction.  Does the mapping for
that have a 'name' attribute?  Does that Form have get/setSearchType
methods?

If you need to "remember" data, it's often easiest to put the Form bean
in session scope.  And you can associate one Form to several different
Actions if it makes sense for your application.  Some people will argue
against session scope, so you may want to consult the archives and see
if their reasons apply to your situation.

> so when they user lands on my form, I want to prepopulate the 
> search type based on what they chose.

That will just magically happen if you let Struts populate the form from
the query string parameter and then use the same Form bean when you
display your HTML form using the JSP.

Rather than confuse the issue, if you still need help, post your
struts-config.xml so we can see what you've got.  

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 


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



RE: blocking bookmarked actions

2004-03-26 Thread Colm Garvey
Or wrap the whole app up in frames. That'll do the trick.

Colm

-Original Message-
From: Mark Shifman [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 18:32
To: Struts Users Mailing List
Subject: Re: blocking bookmarked actions


where do I do the blocking?  The action I am having problems with is a
LookupDispatchAction and I get this kind of error message

javax.servlet.ServletException: Request[/RechartFiles] does not contain
handler parameter named method

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.
java:199)

...

Paul McCulloch wrote:

>You code code your app to always use http POST, but block GETs. This may
not
>be suitable if you've already written the app though!
>
>Paul
>
>
>
>>-Original Message-
>>From: Mark Shifman [mailto:[EMAIL PROTECTED]
>>Sent: 24 March 2004 18:17
>>To: Struts Users Mailing List
>>Subject: blocking bookmarked actions
>>
>>
>>Suppose someone bookmarked an action such as
>>/yourhost/yourapp/someAction.do and you really want them to only go
>>through the html pages.
>>
>>How do your block or catch these actions and redirect them to the
>>appropriate place?
>>
>>mas
>>
>>
>>-
>>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: .swf file

2004-03-26 Thread Colm Garvey
Just the same as any other hyperlink you create with Flash.
Just point your hyperlink to "nameoflink.do" instead of "nameoflink.jsp"

Colm

-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 18:02
To: [EMAIL PROTECTED]
Subject: .swf file


Dear Friends,
Can anybody explain me how to use .swf file as a button in struts framework.

-Jignesh

-
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: Populating a Listbox

2004-03-26 Thread Colm Garvey
I've come across this in a few difference manifestations and the best
course of action I've come across is dependant on the number of variations.

If you're only talking about a couple of hundred or less, use a javascript
array to populate the second dropdown on the fly.

If you're dealing with more than that [6,000 in my case :)] then you're
better
off using an onChange event handler on the first dropdown to submit the page
back to itself and use the action to generate the 2nd one from the database.
By default, I set the first dropdown to the 1st value and populate the 2nd
one based on that selection.

HTH

Colm

-Original Message-
From: Nilesh [mailto:[EMAIL PROTECTED]
Sent: 12 February 2004 05:50
To: Struts Users Mailing List
Subject: Populating a Listbox


I need to populate some lisbox from database at runtime.
Also, there are situations when I populate one list box depending upon the
value selected in another listbox, all from database.

I am using DBCP to connect to mySQL

1)Are there any special tags available in Struts?

2)Can any one suggest a most efficient method to do this, so that there is
minimum fetching from database.

Also please let me know the syntax of populating the listbox and the event
on which it is to be populated, since I have never done it before.
A small sample code(If you have tried it earlier) would help more.

Thanks in advance.
Nilesh.


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



RE: newbie html-el question

2004-03-26 Thread Bender, James
Hi Wendy,

Thanks for responding!  Someone showed me a way to do what I needed to do,
but the way I'm approaching the entire problem may be kludged:

The user can click

Search Attributes | Search Components | Search Templates

I've provided html:link's like these respectively:

doPrepareSearch.do?searchType=attribute |
doPrepareSearch.do?searchType=component |
doPrepareSearch.do?searchType=template

so when they user lands on my form, I want to prepopulate the search type
based on what they chose.  If they submit a search with bad data, then I'd
want the SearchForm's (extends ActionForm) validate() method to send the
back to the search form, this time keeping their most recent entries to the
form field -- if they changed search type for example now it would be
different.  

I am new to Struts and may not be getting a key concept of it's Best
Practices usage.  Does it make sense what I've described?  Thanks again!,

Jim


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 2:03 PM
To: Struts Users Mailing List
Subject: RE: newbie html-el question


From: Bender, James [mailto:[EMAIL PROTECTED] 
> I am trying to display a value from a requestAttribute in 
an  ...> but I can't get it to work.  Here is my code:
>  value="<%=request.getAttribute("searchType")%>"/>
> 
> I recieve the error:
> "Attribute searchType has no value"
> Someone told me I have to do something more like this:
> 
> 
> but where would I define the variable searchType that is 
> accessed there?

You wouldn't, you'd set the property of the Form bean and let Struts
handle it.  

If you need to pre-populate the form, you do that in the Action by
calling setSearchType() on your Form bean.  Then when you forward to the
JSP, Struts will fill in the value.

Can you explain more about your situation?  I'm making some assumptions
that may not be correct.

In general there's no need to touch the 'value' attribute of the tags
that render HTML form elements.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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


This e-mail transmission contains information that is confidential and may be 
privileged.   It is intended only for the addressee(s) named above. If you receive 
this e-mail in error, please do not read, copy or disseminate it in any manner. If you 
are not the intended recipient, any disclosure, copying, distribution or use of the 
contents of this information is prohibited. Please reply to the message immediately by 
informing the sender that the message was misdirected. After replying, please erase it 
from your computer system. Your assistance in correcting this error is appreciated.

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



RE: where values have embedded quotes

2004-03-26 Thread Colm Garvey
It might not be sexy, but a fast solution would be to use something
else instead of quotes e.g. ^ or | and then use a
small Javascript replace function to write out the text correctly?

Colm

-Original Message-
From: Doug [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 23:25
To: Struts Users Mailing List
Subject: Re:  where values have embedded quotes


Anyone?

Doug wrote:

> We have some customer-supplied selection options that have double quotes 
> in their values, and Struts 1.1 isn't seeming to handle this correctly.
> 
> Best I can tell from the HTML spec, these should be placed on the page 
> as " , which will submit them as %22 , which *should* be seen on 
> the server side as double quotes again, right?  And Struts should be 
> able to match that to an existing entry so it can properly set the 
> "selected" value.
> 
> Instead, it seems the options tag isn't "escaping" the quotes at all 
> (changing them to ") and that if we manually do it ourselves, the 
> "selected" item still isn't being set when the page is reloaded.  IIRC, 
> the tag is just leaving the quotes inside the attribute value, which 
> outputs invalid HTML.
> 
> Am I missing something?  Is there a better way to do this?  Thanks.
> 
> Doug

-
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: Why there is no getHeader(String headerName) and getHeaders() met hod in HttpServletResponse?

2004-03-26 Thread Yee, Richard K,,DMDCWEST
Larry,
For debugging purposes, the org.apache.soap.util.net.TcpTunnelGui utility is
useful. It's in the Jakarta Soap project jar file. It will let you view the
headers and the markup sent to/from your browser.

-Richard


-Original Message-
From: Zhang, Larry (L.) [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 11:47 AM
To: 'Struts Users Mailing List'
Subject: RE: Why there is no getHeader(String headerName) and getHeaders()
met hod in HttpServletResponse?


Richard,

Thanks for your answers. I think that makes great sense; though I still
think to have getHeader() or getHeaders() may be helpful when doing debug
for response object.

Larry

-Original Message-
From: Richard Yee [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 12:06 PM
To: Struts Users Mailing List
Subject: Re: Why there is no getHeader(String headerName) and
getHeaders() met hod in HttpServletResponse?


Larry,
I'll go out on a limb here and say that since the
response is being generated on the server by a servlet
or JSP, there is no need for getHeader() or
getHeaders() methods because the developer is setting
them. The HttpServletResponse interface has
addHeader() and addXXXHeader() methods to add headers
to the response. There is also the containsHeader()
method which returns a boolean.

-Richard

--- "Zhang, Larry (L.)" <[EMAIL PROTECTED]> wrote:
> Folks, this may be an off topic question, but I am
> curious to understand why.
> 
> We know that Http protocol has features such as
> Headers. Both response and request have HTTP
> headers. It is easy to get the headers in J2EE from
> a HttpServletRequest objects using getHeader()
> and/or getHeaders() methods, however, there is no corresponding 
> methods in HttpServletResponse. What is the reasoning behind this 
> design?
> 
> Thanks.
> 
> Larry Zhang
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

-
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: Why there is no getHeader(String headerName) and getHeaders() met hod in HttpServletResponse?

2004-03-26 Thread Zhang, Larry (L.)
Richard,

Thanks for your answers. I think that makes great sense; though I still think to have 
getHeader() or getHeaders() may be helpful when doing debug for response object.

Larry

-Original Message-
From: Richard Yee [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 12:06 PM
To: Struts Users Mailing List
Subject: Re: Why there is no getHeader(String headerName) and
getHeaders() met hod in HttpServletResponse?


Larry,
I'll go out on a limb here and say that since the
response is being generated on the server by a servlet
or JSP, there is no need for getHeader() or
getHeaders() methods because the developer is setting
them. The HttpServletResponse interface has
addHeader() and addXXXHeader() methods to add headers
to the response. There is also the containsHeader()
method which returns a boolean.

-Richard

--- "Zhang, Larry (L.)" <[EMAIL PROTECTED]> wrote:
> Folks, this may be an off topic question, but I am
> curious to understand why.
> 
> We know that Http protocol has features such as
> Headers. Both response and request have HTTP
> headers. It is easy to get the headers in J2EE from
> a HttpServletRequest objects using getHeader()
> and/or getHeaders() methods, however, there is no
> corresponding methods in HttpServletResponse. What
> is the reasoning behind this design?
> 
> Thanks.
> 
> Larry Zhang
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

-
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: Pls help me in configuring common logger

2004-03-26 Thread Van Riper, Mike
Sougata,

I can point you in the right direction, but, I don't have time to spell
everything out for you. I think you need to do some work on your own reading
the commons logging docs. You need to  understand the commons logging
package and how to configure it to use log4j or the native logging
facilities in JDK 1.4. When I mentioned the simple logger, I was referring
to this implementation of org.apache.commons.logging.Log:

  org.apache.commons.logging.impl.SimpleLog

If you are using the commons logging package, it has a properties file you
can use to specify which Log interface implementation to use. I could be
wrong, but, when this file is not provided my experience has been that it
will automatically detect the presence of a properly configured log4j and
instantiate a org.apache.commons.logging.impl.Log4JLogger. If a properly
configured log4j is not detected, it will default back to the SimpleLog
implementation.

Good Luck, Van

> -Original Message-
> From: sougata [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 26, 2004 4:12 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: Pls help me in configuring common logger
> 
> 
> Hi Van
> I am not using simple logger.I am using apache's  commons 
> logger.Pls le me
> know how to do it
> Thanks
> Sougata
> 
> -Original Message-
> From: Van Riper, Mike [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 26, 2004 12:38 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Pls help me in configuring common logger
> 
> 
> > -Original Message-
> > From: sougata [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 25, 2004 9:15 PM
> > To: Struts Users Mailing List
> > Subject: Pls help me in configuring common logger
> >
> >
> > Hi Guys
> > I am facing a problem in configuration apaches common logger using
> > weblogic8.1.I want to send all my log message to a perticular
> > file.I am
> > using Common logger for my logging message.How to configure
> > Pls let me know
> 
> The simple logger that is included in the commons logging 
> package doesn't
> support logging to a file, just to the console. You need to 
> understand that
> it is primarily intended to provide the common logging API (the simple
> logger is included just to get you started) and then you 
> configure it to use
> whatever logging facility under the covers that you want to. 
> Most people use
> log4j, but, you could also use the native logging support in 
> JDK 1.4 or
> greater.
> 
> I recommend configuring to use log4j. I also recommend taking 
> the time to
> read the short intro manual to log4j found here:
> 
> http://tinyurl.com/3hlrq
> 
> I recently posted the contents of a simple log4j 
> configuration file that
> does have an example of the necessary configuration to write 
> log messages
> both to the console and to file. Check the list archives for 
> a recent post
> on logging by me. I use this setup with Tomcat and Weblogic. The one
> configuration difference I found is that Weblogic doesn't 
> like relative file
> paths for location of log files and Tomcat handles that just fine.
> 
> Good luck, Van
> 
> Mike "Van" Riper
> Silicon Valley Struts User Group
> http://www.baychi.org/bof/struts/
> 
> P.S. You can either remove the commons logging properties 
> file or explicitly
> configure it to use log4j. As long as you setup log4j properly in your
> runtime environment, the commons logging logic will use it by 
> default unless
> you have a commons logging properties file that explicitly specifies a
> different logger implementation.
> 
> > Thanks
> > Sougata
> 
> -
> 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: [OT] "SELECT ... LIKE" with iBatis

2004-03-26 Thread Ronald Rotteveel
Hi Andy,

we have a same kind of statement in our xml file and it looks like this:



 SELECT * FROM tbl_name WHERE column_name LIKE '%';



Pay attention to the single quotes around the %-sign!

Good luck!

Cheers,

Ronald

- Original Message - 
From: "Andy Engle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 26, 2004 7:47 PM
Subject: [OT] "SELECT ... LIKE" with iBatis


> Hi all,
> 
> I am trying to write a "SELECT ... LIKE %whatever%" statement with
> iBatis but I can't seem to get it to work, nor can I find a clear
> explanation of how to do this.  Does anybody have a code snippet they
> could share with me of how to do this?
> 
> Thanks in advance.
> 
> 
> Andy
> 
> 
> -
> 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: Accessing Struts beans with keys defined in the Globals class

2004-03-26 Thread Joe Germuska
At 1:03 PM -0500 3/26/04, [EMAIL PROTECTED] wrote:
Thanks,

but is there a way to do it without using Java code directly in the JSP
page?
In this cases there is not, although this has been discussed just 
today on struts-dev:
http://article.gmane.org/gmane.comp.jakarta.struts.devel/18429/

In short, you're right that there should be a way, but it hasn't been 
done yet.  Feel free to come join in the discussion!

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
-- Jef Raskin

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


RE: newbie html-el question

2004-03-26 Thread Wendy Smoak
From: Bender, James [mailto:[EMAIL PROTECTED] 
> I am trying to display a value from a requestAttribute in 
an  ...> but I can't get it to work.  Here is my code:
>  value="<%=request.getAttribute("searchType")%>"/>
> 
> I recieve the error:
> "Attribute searchType has no value"
> Someone told me I have to do something more like this:
> 
> 
> but where would I define the variable searchType that is 
> accessed there?

You wouldn't, you'd set the property of the Form bean and let Struts
handle it.  

If you need to pre-populate the form, you do that in the Action by
calling setSearchType() on your Form bean.  Then when you forward to the
JSP, Struts will fill in the value.

Can you explain more about your situation?  I'm making some assumptions
that may not be correct.

In general there's no need to touch the 'value' attribute of the tags
that render HTML form elements.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



RE: newbie html-el question

2004-03-26 Thread Slattery, Tim - BLS
 
> I am trying to display a value from a requestAttribute in an 
>  but I can't get it to work.  Here is my code:
 
>  value="<%=request.getAttribute("searchType")%>"/>
> 
> I recieve the error:
 
> "Attribute searchType has no value"
 
> Someone told me I have to do something more like this:
> 


That's exactly what you should be doing
 
> but where would I define the variable searchType that is accessed 
> there?

"searchType" should be saved as an attribute of (preferably) your request
object. Actually, a local variable should also work, you can define it using
the  JSTL tag.

Actually, you shouldn't need to specify a "value" here at all. The
 tag will get the default value from your form bean.


--
Tim Slattery
[EMAIL PROTECTED]


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



Re: [OT] WSAD problems with Struts

2004-03-26 Thread ian_d_stewart
You can also override the global Validation preferences within the
Validation portion of the Project Properties.


Ian



   
   
Susan Bradeen  
   
<[EMAIL PROTECTED]   To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]> 
nding.com>   cc:   
   
     Subject: Re: [OT] WSAD problems with 
Struts  
03/26/2004 
   
08:35 AM   
   
Please respond 
   
to "Struts 
   
Users Mailing  
   
List"  
   
   
   
   
   




Oliver,

What version of WSAD are you running? What problems are you having
specifically?

Validation is controlled through the menu option Window >> Preferences >>
Validation

Susan Bradeen

"Oliver Thiel" <[EMAIL PROTECTED]> wrote on 03/26/2004 08:09:34 AM:

> Hi,
>
>
> I read that some of you had some problems to run
> Struts apps on WSAD and as I run into that problem
> too i wanted to know how you solved it!
>
> I as far as I understand some turned of different validations
> including the on concerning Struts, but where couldn't
> fide the right place to do that!
>
> And are their any outher traps that has to be solved?
>
>
>
> Thank and have a nice weekend
> Oliver
>
> --
> +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz
+++
> 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz
>
>
> -
> 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]







This transmission may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. 
If you received this transmission in error, please immediately contact the sender and 
destroy the material in its entirety, whether in electronic or hard copy format. Thank 
you.


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



Re: How to display a bean property with html markup?

2004-03-26 Thread Bill Siggelkow
And if you wanted to use JSTL you would use:

Bill Siggelkow

Anybody knows how to display a bean property with html
markup properly in the output. I have the JSP snippet
code as follows:


abcdefg 




"filter=false" tells the tag not to replace things like "<" with "<".
That's what you want to hppen in this case.
--
Tim Slattery
[EMAIL PROTECTED]


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


Re: [OT] JTA, JDBC and data persistence

2004-03-26 Thread ian_d_stewart
Freddy,

You may want to take a look at Hibernate (http://www.hibernate.org), if you
haven't done so already.

Hibernate is a persistence mechanism which utilizes XML mappings to map
Java objects to relational database schemas, and does support cascading
deletes, amoung other things.


HTH,
Ian



   

"Freddy Villalba Arias"

<[EMAIL PROTECTED]   To: <[EMAIL PROTECTED]>   
  
matica.es>cc:  

  Subject: [OT] JTA, JDBC and data 
persistence 
03/26/2004 10:59 AM

Please respond to  

"Struts Users Mailing  

List"  

   

   





Hello everybody,



An off-topic question (it's Friday, I hope you accept it!):



I want to implement a Business Object Model on top of many DAOs. Those
BOs will be - obviously - related to each other (mainly 1:n and m:n
relationships).



I must implement this in such way that, when - for example - deleting a
BO that has 3 children associated (therefore, those must be deleted as
well), it's is possible to do so atomically. That is, I need to be able
to delimit the beginning and the end of the transaction that spans the
delete operation on those 4 objects.



I want this to be as transparent and "elegant" as possible. I believe
the right choice for solving this is using JTA objects (that is "XA"
objects) instead of plain JDBC. I've been reading the API and some
papers regarding JTA; I have a fundamental doubt:



Does JTA allows me to delimit (and perform) 2 independent, yet
concurrent transactions??? For instance: 2 users that click the "delete"
button at the same time (it's a web application).



I haven't seen anything like a transaction ID or similar on any example
I've examined. Is this issue transparent to me? Is JTA able, in any way,
to differentiate the Transaction begun from each user's corresponding
instance of the respective BO (the one they wanted to delete... i.e. the
father, not its children)???



I'd appreciate any light you can shed on this matter.



Thanks and regards,

Freddy.







This transmission may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. 
If you received this transmission in error, please immediately contact the sender and 
destroy the material in its entirety, whether in electronic or hard copy format. Thank 
you.


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



Re: Accessing Struts beans with keys defined in the Globals class

2004-03-26 Thread Denis . Laroche

Thanks,

but is there a way to do it without using Java code directly in the JSP
page?



   
   
  Nizeyimana   
   
  Zabulon  To:  Struts Users Mailing List 
<[EMAIL PROTECTED]>
  <[EMAIL PROTECTED]> cc:  
  
   Subject: Re: Accessing Struts beans 
with keys defined in the Globals class 
  03/26/2004 11:43 
   
  AM   
   
  Please respond   
   
  to Struts Users  
   
  Mailing List 
   
   
   
   
   




try this
session.getAttribute(Globals.LOCALE_KEY);














 --- Denis Laroche <[EMAIL PROTECTED]> a écrit : >
Hello everybody,
>
> I hope it's not a trivial question.
>
> I'm trying to access the current Locale from a JSP
> page. The key to
> access the Locale is stored in variable
> org.apache.struts.Globals.LOCALE_KEY. So what I did
> is to look up the
> value of the variable in the source file
> org.apache.struts.Globals.java
> and used that value in a JSP page like this:
>
> ${sessionScope['org.apache.struts.action.LOCALE']}
>
> It works but I'm wondering if there's a more direct
> way, maybe using one
> of the tags provided by the Struts framework, to
> access beans stored
> under keys defined in Globals.java.
>
> Thanks in advance for any help.
>
> --
> Denis Laroche
> Pratt & Whitney Canada, Test Facilities
> phone 450-677-9411 ext. 5224
> pager 514-853-9863
> [EMAIL PROTECTED]
>
>
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>






Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez
Yahoo! Messenger sur http://fr.messenger.yahoo.com

-
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: [OT] JTA, JDBC and data persistence

2004-03-26 Thread Bill Siggelkow
Freddy, I think you only need to look into using JTA and XA transactions 
if you are spanning multiple data sources (databases).  If you are not, 
then I would look into using an Object-relational mapping tool like 
Hibernate or OJB to do what you want to do.  These tools usually provide 
 support for transactions, in addition to providing a mapping layer for 
your objects.

Freddy Villalba Arias wrote:
Hello everybody,

 

An off-topic question (it's Friday, I hope you accept it!):

 

I want to implement a Business Object Model on top of many DAOs. Those
BOs will be - obviously - related to each other (mainly 1:n and m:n
relationships).
 

I must implement this in such way that, when - for example - deleting a
BO that has 3 children associated (therefore, those must be deleted as
well), it's is possible to do so atomically. That is, I need to be able
to delimit the beginning and the end of the transaction that spans the
delete operation on those 4 objects.

 

I want this to be as transparent and "elegant" as possible. I believe
the right choice for solving this is using JTA objects (that is "XA"
objects) instead of plain JDBC. I've been reading the API and some
papers regarding JTA; I have a fundamental doubt:
 

Does JTA allows me to delimit (and perform) 2 independent, yet
concurrent transactions??? For instance: 2 users that click the "delete"
button at the same time (it's a web application).
 

I haven't seen anything like a transaction ID or similar on any example
I've examined. Is this issue transparent to me? Is JTA able, in any way,
to differentiate the Transaction begun from each user's corresponding
instance of the respective BO (the one they wanted to delete... i.e. the
father, not its children)???
 

I'd appreciate any light you can shed on this matter.

 

Thanks and regards,

Freddy.




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


Re: Global locale in Struts web applications?

2004-03-26 Thread Nizeyimana Zabulon
try change the scope of the le locale from "session"
to "application"


 --- Jan Normann Nielsen <[EMAIL PROTECTED]> a
écrit : > Hello
> 
> I have multiple Struts web applications deployed
> within Jetty but the 
> locale that Struts saves in the session is not
> shared between the 
> contexts. I guess that is to be expected. But how do
> I create a 
> work-around for this problem? I need the
> applications to share the 
> locale so that if you change the locale in one of
> them, it is also 
> changed in the others.
> 
> Best regards,
> Jan Nielsen
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  






Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! 
Messenger sur http://fr.messenger.yahoo.com

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



Re: Accessing Struts beans with keys defined in the Globals class

2004-03-26 Thread Nizeyimana Zabulon
try this
session.getAttribute(Globals.LOCALE_KEY);














 --- Denis Laroche <[EMAIL PROTECTED]> a écrit : >
Hello everybody,
> 
> I hope it's not a trivial question.
> 
> I'm trying to access the current Locale from a JSP
> page. The key to 
> access the Locale is stored in variable 
> org.apache.struts.Globals.LOCALE_KEY. So what I did
> is to look up the 
> value of the variable in the source file
> org.apache.struts.Globals.java 
> and used that value in a JSP page like this:
> 
> ${sessionScope['org.apache.struts.action.LOCALE']}
> 
> It works but I'm wondering if there's a more direct
> way, maybe using one 
> of the tags provided by the Struts framework, to
> access beans stored 
> under keys defined in Globals.java.
> 
> Thanks in advance for any help.
> 
> -- 
> Denis Laroche
> Pratt & Whitney Canada, Test Facilities
> phone 450-677-9411 ext. 5224
> pager 514-853-9863
> [EMAIL PROTECTED]
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  






Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! 
Messenger sur http://fr.messenger.yahoo.com

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



Re: Why there is no getHeader(String headerName) and getHeaders() met hod in HttpServletResponse?

2004-03-26 Thread Richard Yee
Larry,
I'll go out on a limb here and say that since the
response is being generated on the server by a servlet
or JSP, there is no need for getHeader() or
getHeaders() methods because the developer is setting
them. The HttpServletResponse interface has
addHeader() and addXXXHeader() methods to add headers
to the response. There is also the containsHeader()
method which returns a boolean.

-Richard

--- "Zhang, Larry (L.)" <[EMAIL PROTECTED]> wrote:
> Folks, this may be an off topic question, but I am
> curious to understand why.
> 
> We know that Http protocol has features such as
> Headers. Both response and request have HTTP
> headers. It is easy to get the headers in J2EE from
> a HttpServletRequest objects using getHeader()
> and/or getHeaders() methods, however, there is no
> corresponding methods in HttpServletResponse. What
> is the reasoning behind this design?
> 
> Thanks.
> 
> Larry Zhang
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



RE: html:text -- value attribute won't take rtexprvalue

2004-03-26 Thread Wendy Smoak
> From: Bender, James [mailto:[EMAIL PROTECTED] 
> > I'm new to Struts and have searched without luck on this one:
> > I have an  that I'm simply trying to put a runtime
> > expression into, like
> > <% String rtexpr = "bob"; %>
> > 
> > And instead of interprestting the rtexprvalue "bob", it 
> actually displays
> > the string "<%=rtexpr %>" as the value on the screen.  If I 
> just type a
> > string into the value field, like this:
> > 

James, did you post this on struts-user yet?  Unless there's more to it
than I initially see, I think it belongs over there rather than the
developers list.
If I did it right, the reply-to is set there.

The usual way to do this is to populate the Form property in your Action
code, and then when you forward to the JSP containing the 
tag, Struts will render the HTML for the form element, including the
value.  Note that Struts automatically populates the form from the
request attributes when the user submits the form.  I'm not sure whether
you're trying to pre-populate, or to redisplay user input.

This assumes that you are forcing users to go through the Action (not
letting them go directly to the JSP).  More information will help us
here, I'm avoiding answering your actual question since you did say
you're new to Struts...

If you do find yourself needing to pull things out of the
request/session, the Struts-EL tags will be useful-- 

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



RE: access variable value in html tag

2004-03-26 Thread Steltner, Joern
Hallo together,

Thx, for the help. I installed the Tomcat v5.x engine and now it's working
like you guys suggested without EL. 

Regards
Joern

-Original Message-
From: Brian Buchanan [mailto:[EMAIL PROTECTED] 
Sent: Dienstag, 23. März 2004 15:12
To: Struts Users Mailing List
Subject: RE: access variable value in html tag


The Struts-EL is what I'd recommend, which supports exactly what you want to
do, unless you're into (Tomcat 5 and the) JSP 2.0 then you'd just do:
${accounts.number}

Otherwise I _think_ I've done this nastiness and it worked, but I might have
been doing it with plain HTML (non-struts tags):

">

._.

-Original Message-
From: Steltner, Joern [mailto:[EMAIL PROTECTED]
Sent: Friday, March 19, 2004 7:28 AM
To: [EMAIL PROTECTED]
Subject: access variable value in html tag


Dear,

I'm not an expert in Struts and Java. I need some simple help:


 
  
 


Everything works fine, but at ??? mark I would like take
account.no_account like ${accounts.number}, but it doesn't work. May someone
can give me a small note about the right syntax to get the value from
accounts.number as text in the quotes.

Thanks

Regards
J. Steltner



-
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: Dynaform Type Conversion

2004-03-26 Thread Joe Germuska
--- Joe Hertz <[EMAIL PROTECTED]> wrote:
 > Does Struts provide a method where I provide it the name of the bean
 > defined
 > in the struts-config.xml and it return me an instance of the appropriate
 > class, with all the dyna properties set up?
At 3:19 PM -0800 3/25/04, Hubert Rabago wrote:
It does for the nightly build and Struts 1.2.0, though I can't recall the
name of the method.  For pre-1.2, you'll need to write code to do that.
There was a thread that discussed this, with the last few messages (of that
thread) still coming in today.  Just look for that.  Richard Yee pasted code
there on how to instantiate a Dyna Bean.  I also pointed to an archive where
I pasted the code I use in my apps to instantiate a Dyna Bean.
Right now, you can look up a FormBeanConfig object from a 
ModuleConfig, and then you can use the FormBeanConfig and the 
ActionServlet to get a new ActionForm instance from RequestUtils. 
This does not go through the request/session scope searching that 
Struts uses when it processes the request parameters into a populated 
ActionForm.

Given the fact that this has come up three or four times in the last 
week, it seems clear that it's time to expose a simple method that 
takes a form bean name and a scope and either finds or creates that 
form bean.  I'm just waiting for a few things to settle down -- 
there's going to be a Struts 1.2.1 release pretty soon now, and we 
have to move the CVS repository to a new location as part of Struts 
becoming a top-level Apache project...  but that stuff should get 
straightened out in the next week or two.

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
-- Jef Raskin

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


Re: Calling Class Methods

2004-03-26 Thread Nizeyimana Zabulon
let say your class' name is A and your static method
is aaa();
all you hava to do is A.aaa(); 

 --- Sunny <[EMAIL PROTECTED]> a écrit : > How can i
invoke static methods of a Class without
> instantiating it in 
> struts
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  






Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! 
Messenger sur http://fr.messenger.yahoo.com

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



RE: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Martin Alley
I'll be very interested to here the outcome...

Thanks
Martin


-Original Message-
From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 16:07
To: Struts Users Mailing List
Subject: RE: How does ActionForm data pass through container called form
based login page?


We were going to implement this today or early next week :-)...looking
at
the code, I feel you don't need to extend ActionServlet at all. Instead
the
filter will create the request before forwarding to the ActionServlet.

public class LoginFilter implements Filter {
  public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {

HttpServletRequest req = (HttpServletRequest)request;
ServletContext context = filterConfig.getServletContext();

If ( !loggedIn ) {
// save all parameters to session
// save current URI as REDIRECT_URI in session
// redirect to login action
} else if ( redirectUriIsSet ) {
RedirectServletRequest newreq = new

RedirectServletRequest(request);
Chain.doFilter(newreq, response);
}
}

Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 10:35 AM
To: 'Struts Users Mailing List'
Subject: RE: How does ActionForm data pass through container called form
based login page?

Paddy,

Looks like you've been here before!! :-)

It'll take me a bit of time to digest this, but I'll have a look.

Does this actually work for you?

Thanks
Martin

-Original Message-
From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 15:21
To: Struts Users Mailing List
Subject: RE: How does ActionForm data pass through container called form
based login page?


This is the only solution I can think of:

public class RedirectServletRequest extends HttpServletRequest {
public RedirectServletRequest(HttpServletRequest req) {
this.request = req;
}

public String getParameter(String name) {
if ( request.getParameter(name) == null ) {
String paramVal = (String)request.getSession().

getAttribute("TEMP_SAVED_PARAM");

request.getSession().removeAttribute("TEMP_SAVED_PARAM");
return paramVal;
}
return (String)request.getParameter(name);
}

// override all other methods using the delegate request
}

public class RedirectActionServlet extends ActionServlet {
public void doPost(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
public void doGet(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
}

public class LoginFilter implements Filter {
  public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {

HttpServletRequest req = (HttpServletRequest)request;
ServletContext context = filterConfig.getServletContext();

If ( !loggedIn ) {
// save all parameters to session
// save current URI as REDIRECT_URI in session
// redirect to login action
}
}

public class LoginAction extends Action {

public void execute(...) {
// do login 
// login success
// redirect to REDIRECT_URI
}
}



Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 8:59 AM
To: 'Struts Users Mailing List'
Subject: RE: How does ActionForm data pass through container called form
based login page?

Well I've just simplified by login form  - plain html - no struts stuff
going on.

I've also simplified the filter so detects a fresh logon and starts a
session accordingly - no longer any redirecting to LoginAction.

However the critical behaviour is still the same - existingCustomerForm
- the one I need to survive the login process still ends up getting
trashed.

I'm wondering if I have to make every form (that might span a session
timeout) part of the login page so that it stays alive - this sounds
like a ridiculous solution.  Has anyone else got a solution?

Thanks
Martin

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 09:41
To: [EMAIL PROTECTED]
Subject: How does ActionForm data pass through container called form
based login page?

Hi,

Suppose I've got a web based form that posts data to an action, and I
have that action protected by container form bas

RE: How does ActionForm data pass through container called form b ased login page?

2004-03-26 Thread Pady Srinivasan

We were going to implement this today or early next week :-)...looking at
the code, I feel you don't need to extend ActionServlet at all. Instead the
filter will create the request before forwarding to the ActionServlet.

public class LoginFilter implements Filter {
  public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {

HttpServletRequest req = (HttpServletRequest)request;
ServletContext context = filterConfig.getServletContext();

If ( !loggedIn ) {
// save all parameters to session
// save current URI as REDIRECT_URI in session
// redirect to login action
} else if ( redirectUriIsSet ) {
RedirectServletRequest newreq = new

RedirectServletRequest(request);
Chain.doFilter(newreq, response);
}
}

Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 10:35 AM
To: 'Struts Users Mailing List'
Subject: RE: How does ActionForm data pass through container called form
based login page?

Paddy,

Looks like you've been here before!! :-)

It'll take me a bit of time to digest this, but I'll have a look.

Does this actually work for you?

Thanks
Martin

-Original Message-
From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 15:21
To: Struts Users Mailing List
Subject: RE: How does ActionForm data pass through container called form
based login page?


This is the only solution I can think of:

public class RedirectServletRequest extends HttpServletRequest {
public RedirectServletRequest(HttpServletRequest req) {
this.request = req;
}

public String getParameter(String name) {
if ( request.getParameter(name) == null ) {
String paramVal = (String)request.getSession().

getAttribute("TEMP_SAVED_PARAM");

request.getSession().removeAttribute("TEMP_SAVED_PARAM");
return paramVal;
}
return (String)request.getParameter(name);
}

// override all other methods using the delegate request
}

public class RedirectActionServlet extends ActionServlet {
public void doPost(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
public void doGet(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
}

public class LoginFilter implements Filter {
  public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {

HttpServletRequest req = (HttpServletRequest)request;
ServletContext context = filterConfig.getServletContext();

If ( !loggedIn ) {
// save all parameters to session
// save current URI as REDIRECT_URI in session
// redirect to login action
}
}

public class LoginAction extends Action {

public void execute(...) {
// do login 
// login success
// redirect to REDIRECT_URI
}
}



Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 8:59 AM
To: 'Struts Users Mailing List'
Subject: RE: How does ActionForm data pass through container called form
based login page?

Well I've just simplified by login form  - plain html - no struts stuff
going on.

I've also simplified the filter so detects a fresh logon and starts a
session accordingly - no longer any redirecting to LoginAction.

However the critical behaviour is still the same - existingCustomerForm
- the one I need to survive the login process still ends up getting
trashed.

I'm wondering if I have to make every form (that might span a session
timeout) part of the login page so that it stays alive - this sounds
like a ridiculous solution.  Has anyone else got a solution?

Thanks
Martin

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 09:41
To: [EMAIL PROTECTED]
Subject: How does ActionForm data pass through container called form
based login page?

Hi,

Suppose I've got a web based form that posts data to an action, and I
have that action protected by container form based authorization - how
does the ActionForm data get through.

I have a situation like this, and my ActionForm is empty after I've been
through the form-based login page.

One could say - stick the input form in the constrained area also, so
the login page doesn't come between the i

RE: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Martin Alley
I think I need to do some simple test cases - with and without struts.

Martin

-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 15:20
To: Struts Users Mailing List
Subject: RE: How does ActionForm data pass through container called form
based login page?

>I might be able to put some general code in the login form (as a jsp)
>that puts all form data present in the previous page into the login
form
>so it could be passed on, but that will still leave the problem of the
>method becomes GET instead of POST.
>
>I'm really hoping there's a more elegant solution - after this
>technology's been around for a while!

Yeah, but there are some basic limitations to the container managed 
security model, and I haven't heard any signs that they are being 
addressed.  For example, container managed security doesn't allow you 
to present a login form to a user as a component of any page besides 
the single registered form, and it doesn't allow you to server 
resources from one path with two different states, "user authorized" 
or "not authorized"...  Both of those are standard in modern webapps, 
but there's no clean way to handle them using container managed 
security.  (I saw a JDJ article last year that had some work 
arounds...)

So that said, it may not be surprising that the container managed 
security model also has no support for continuing the flow of request 
data to the originally requested URL after logging in.

Joe


-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
   "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
 -- Jef Raskin

-
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: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Martin Alley
Paddy,

Looks like you've been here before!! :-)

It'll take me a bit of time to digest this, but I'll have a look.

Does this actually work for you?

Thanks
Martin

-Original Message-
From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 15:21
To: Struts Users Mailing List
Subject: RE: How does ActionForm data pass through container called form
based login page?


This is the only solution I can think of:

public class RedirectServletRequest extends HttpServletRequest {
public RedirectServletRequest(HttpServletRequest req) {
this.request = req;
}

public String getParameter(String name) {
if ( request.getParameter(name) == null ) {
String paramVal = (String)request.getSession().

getAttribute("TEMP_SAVED_PARAM");

request.getSession().removeAttribute("TEMP_SAVED_PARAM");
return paramVal;
}
return (String)request.getParameter(name);
}

// override all other methods using the delegate request
}

public class RedirectActionServlet extends ActionServlet {
public void doPost(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
public void doGet(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
}

public class LoginFilter implements Filter {
  public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {

HttpServletRequest req = (HttpServletRequest)request;
ServletContext context = filterConfig.getServletContext();

If ( !loggedIn ) {
// save all parameters to session
// save current URI as REDIRECT_URI in session
// redirect to login action
}
}

public class LoginAction extends Action {

public void execute(...) {
// do login 
// login success
// redirect to REDIRECT_URI
}
}



Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 8:59 AM
To: 'Struts Users Mailing List'
Subject: RE: How does ActionForm data pass through container called form
based login page?

Well I've just simplified by login form  - plain html - no struts stuff
going on.

I've also simplified the filter so detects a fresh logon and starts a
session accordingly - no longer any redirecting to LoginAction.

However the critical behaviour is still the same - existingCustomerForm
- the one I need to survive the login process still ends up getting
trashed.

I'm wondering if I have to make every form (that might span a session
timeout) part of the login page so that it stays alive - this sounds
like a ridiculous solution.  Has anyone else got a solution?

Thanks
Martin

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 09:41
To: [EMAIL PROTECTED]
Subject: How does ActionForm data pass through container called form
based login page?

Hi,

Suppose I've got a web based form that posts data to an action, and I
have that action protected by container form based authorization - how
does the ActionForm data get through.

I have a situation like this, and my ActionForm is empty after I've been
through the form-based login page.

One could say - stick the input form in the constrained area also, so
the login page doesn't come between the input form and the action that
processes it - but this is actually occurring when a session times out
whilst sitting at the input form.

Thanks
Martin




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


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

__
This e-mail has been scanned by the Heroix e-mail security system
__

-
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: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Joe Germuska
I might be able to put some general code in the login form (as a jsp)
that puts all form data present in the previous page into the login form
so it could be passed on, but that will still leave the problem of the
method becomes GET instead of POST.
I'm really hoping there's a more elegant solution - after this
technology's been around for a while!
Yeah, but there are some basic limitations to the container managed 
security model, and I haven't heard any signs that they are being 
addressed.  For example, container managed security doesn't allow you 
to present a login form to a user as a component of any page besides 
the single registered form, and it doesn't allow you to server 
resources from one path with two different states, "user authorized" 
or "not authorized"...  Both of those are standard in modern webapps, 
but there's no clean way to handle them using container managed 
security.  (I saw a JDJ article last year that had some work 
arounds...)

So that said, it may not be surprising that the container managed 
security model also has no support for continuing the flow of request 
data to the originally requested URL after logging in.

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
-- Jef Raskin

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


Re: Struts Validator and Select boxes

2004-03-26 Thread Niall Pemberton
Posting whats in your validation.xml for the form and the bit of your jsp
with your select fields would be helpfull.

If you take the "fromDay" as an example, you are using
field.getVarValue("fromDay")  - if you don't have a "var" defined in your
validation.xml for "fromDay" then that would cause the "No Name Specified"
error - same goes for "fromYear", "toMonth", "toDay" and "toYear".

As for getting nulls, looks to me again that whats specified for the "vars"
in your validation.xml doesn't tie up with the names specified on your form.

>From your code I would expect something like the following in your
validation.xml



fromDay
  formFromDay

fromYear
  formFromYear

toMonth
  formToMonth

toDay
  formToDay

toYear
  formToYear




Do you have the properties in your form correct (i.e in this example
formFromDay, formFromYear, formToMonth, formToDay, formToYear).

Niall


- Original Message - 
From: "Janarthan Sathiamurthy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 25, 2004 4:46 PM
Subject: Struts Validator and Select boxes


Hi,

I am using Struts validator.
One page of mine has dates displayed as "MM"  "DD" "".
All the above 3 are displayed in seprate combo/select boxes.
I need to do some custom validations on these fields.
I wrote a custom class for the same
Looks like -
   public static boolean validateDates(Object bean,
ValidatorAction validatorAction,
Field field, ActionErrors errors,
HttpServletRequest request)
   {
  String actionType = ValidatorUtil.getValueAsString(bean,

field.getVarValue("actionType")); // A hidden form field
  String fromMonth = ValidatorUtil.getValueAsString(bean,

field.getProperty());
  String fromDay = ValidatorUtil.getValueAsString(bean,

field.getVarValue("fromDay"));
  String fromYear = ValidatorUtil.getValueAsString(bean,

field.getVarValue("fromYear"));
  String toMonth = ValidatorUtil.getValueAsString(bean,

field.getVarValue("toMonth"));
  String toDay = ValidatorUtil.getValueAsString(bean,

field.getVarValue("toDay"));
  String toYear = ValidatorUtil.getValueAsString(bean,

field.getVarValue("toYear"));

  System.out.println("actionType " + actionType);
  System.out.println("fromMonth " + fromMonth);
  System.out.println("fromDay " + fromDay);
  System.out.println("fromYear " + fromYear);
  System.out.println("toMonth " + toMonth);
  System.out.println("toDay " + toDay);
  System.out.println("toYear " + toYear);

  return true;
   }

O/P of the above code -
actionType searchPage
fromMonth 2
fromDay null
fromYear null
toMonth null
toDay null
toYear null

It also gives me "No Name Specified error".
Point to note is that the all other fields other than 'actionType' are
select boxes. It gives a null for all the field types that are of
html:select.
Is this a known BUG or am i going wrong somewhere ?


Error LOG -
Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil
getValueAsString
SEVERE: No name specified
java.lang.IllegalArgumentException: No name specified
at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j
ava:721)
at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80
1)
at
org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.ja
va:121)
at
com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDa
teValidator.j
ava:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:4
54)
at
org.apache.commons.validator.Validator.validateField(Validator.java:544)
at
org.apache.commons.validator.Validator.validate(Validator.java:582)
at
org.apache.struts.validator.DynaValidatorActionForm.validate(DynaValidatorAc
tionForm.java
:125)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
ava:942)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(

RE: How does ActionForm data pass through container called form b ased login page?

2004-03-26 Thread Pady Srinivasan

This is the only solution I can think of:

public class RedirectServletRequest extends HttpServletRequest {
public RedirectServletRequest(HttpServletRequest req) {
this.request = req;
}

public String getParameter(String name) {
if ( request.getParameter(name) == null ) {
String paramVal = (String)request.getSession().

getAttribute("TEMP_SAVED_PARAM");

request.getSession().removeAttribute("TEMP_SAVED_PARAM");
return paramVal;
}
return (String)request.getParameter(name);
}

// override all other methods using the delegate request
}

public class RedirectActionServlet extends ActionServlet {
public void doPost(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
public void doGet(HttpServletRequest request, ...) {
process(new RedirectActionServlet(request), response);
}
}

public class LoginFilter implements Filter {
  public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {

HttpServletRequest req = (HttpServletRequest)request;
ServletContext context = filterConfig.getServletContext();

If ( !loggedIn ) {
// save all parameters to session
// save current URI as REDIRECT_URI in session
// redirect to login action
}
}

public class LoginAction extends Action {

public void execute(...) {
// do login 
// login success
// redirect to REDIRECT_URI
}
}



Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 8:59 AM
To: 'Struts Users Mailing List'
Subject: RE: How does ActionForm data pass through container called form
based login page?

Well I've just simplified by login form  - plain html - no struts stuff
going on.

I've also simplified the filter so detects a fresh logon and starts a
session accordingly - no longer any redirecting to LoginAction.

However the critical behaviour is still the same - existingCustomerForm
- the one I need to survive the login process still ends up getting
trashed.

I'm wondering if I have to make every form (that might span a session
timeout) part of the login page so that it stays alive - this sounds
like a ridiculous solution.  Has anyone else got a solution?

Thanks
Martin

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 09:41
To: [EMAIL PROTECTED]
Subject: How does ActionForm data pass through container called form
based login page?

Hi,

Suppose I've got a web based form that posts data to an action, and I
have that action protected by container form based authorization - how
does the ActionForm data get through.

I have a situation like this, and my ActionForm is empty after I've been
through the form-based login page.

One could say - stick the input form in the constrained area also, so
the login page doesn't come between the input form and the action that
processes it - but this is actually occurring when a session times out
whilst sitting at the input form.

Thanks
Martin




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


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

__
This e-mail has been scanned by the Heroix e-mail security system
__

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



RE: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Martin Alley
Hi Joe,

I might be able to put some general code in the login form (as a jsp)
that puts all form data present in the previous page into the login form
so it could be passed on, but that will still leave the problem of the
method becomes GET instead of POST.

I'm really hoping there's a more elegant solution - after this
technology's been around for a while!

Thanks
Martin

-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 14:21
To: Struts Users Mailing List
Subject: RE: How does ActionForm data pass through container called form
based login page?

At 1:59 PM + 3/26/04, Martin Alley wrote:
>Well I've just simplified by login form  - plain html - no struts stuff
>going on.
>
>I've also simplified the filter so detects a fresh logon and starts a
>session accordingly - no longer any redirecting to LoginAction.
>
>However the critical behaviour is still the same - existingCustomerForm
>- the one I need to survive the login process still ends up getting
>trashed.
>
>I'm wondering if I have to make every form (that might span a session
>timeout) part of the login page so that it stays alive - this sounds
>like a ridiculous solution.  Has anyone else got a solution?

It may be a little ridiculous, but if the security implementation 
doesn't pass along form data when it forwards to the intended 
destination, then there's not much you can do about it.

I'm assuming that the container is intercepting before Struts ever 
gets a chance to create an ActionForm based on the submission, so I 
don't think that making them session scoped is likely to help.

This probably doesn't constitute a solution, but perhaps extending 
the session timeout would help a bit.  Perhaps you could come up with 
some kind of javascript hack which calls a URL against the struts app 
periodically to keep the session alive?

Joe
-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
   "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
 -- Jef Raskin

-
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: html inside an action

2004-03-26 Thread Niall Pemberton
I posted a tag (StoreTag) which will store the generated html from a jsp in
a bean, then in your action you can get the RequestDispatchter and do an
"include":

Details in the following messages:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg94956.html
http://www.mail-archive.com/[EMAIL PROTECTED]/msg94935.html


Niall

- Original Message - 
From: "ruben" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 25, 2004 3:59 PM
Subject: html inside an action


> hi!
> how can i get the output generate in a .jsp inside an action like it was
> a resource that i can process(a String or something else)???
> thanks a lot in advance.
>
> PD: I need to call jasper compiler or something similar? what can i do
> that? thanks
>
>
> -
> 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: Pls help me in configuring common logger

2004-03-26 Thread roy-strutsuser
On 26 Mar 2004 13:59:25 -, struts-user-digest-help wrote
> Re: Pls help me in configuring common logger
>   109791 by: sougata

sougata, if you're using Log4j you need to add a file called
commons-logging.properties file under your WEB-INF/classes directory.  In that
file you need one line:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

Its been my experience that the commons logger does not actually default to
Log4j if its available.

Here is an example of a log4j.properties file:
log4j.rootLogger=ERROR, A1, A2

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=[file path]
log4j.appender.A2.append=true
log4j.appender.A2.layout=org.apache.log4j.PatternLayout 
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

The first one is configured for standard out.  The second one writes logs to a
file [file path].  This file should also go under WEB-INF/classes

Roy.

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



RE: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Joe Germuska
At 1:59 PM + 3/26/04, Martin Alley wrote:
Well I've just simplified by login form  - plain html - no struts stuff
going on.
I've also simplified the filter so detects a fresh logon and starts a
session accordingly - no longer any redirecting to LoginAction.
However the critical behaviour is still the same - existingCustomerForm
- the one I need to survive the login process still ends up getting
trashed.
I'm wondering if I have to make every form (that might span a session
timeout) part of the login page so that it stays alive - this sounds
like a ridiculous solution.  Has anyone else got a solution?
It may be a little ridiculous, but if the security implementation 
doesn't pass along form data when it forwards to the intended 
destination, then there's not much you can do about it.

I'm assuming that the container is intercepting before Struts ever 
gets a chance to create an ActionForm based on the submission, so I 
don't think that making them session scoped is likely to help.

This probably doesn't constitute a solution, but perhaps extending 
the session timeout would help a bit.  Perhaps you could come up with 
some kind of javascript hack which calls a URL against the struts app 
periodically to keep the session alive?

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
-- Jef Raskin

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


Re: [OT] WSAD problems with Struts

2004-03-26 Thread Oliver Thiel
Hi,


I have to use: WebSphere Studio Application Developer (Windows)  Version:
5.1.0

I developed my app with the StrutsStudio, as it is not that complex. But
know I have 
to run it on WSAD and run into different problems:

a. WSAD did not like the validation.XML 
   (so deleted it cause I did not use it anyway)

b. I use iBatis for the DB stuff and iBatis needs a newer JDOM version. 
   (so I integrated that and the coresponding DTDs for iBatis, as I was 
not able to referenc it from the net)

so far everything seams to work, but know I got some straing error messages,

that i did not define my ibatis xml  files correctly?!?

But the same app works fine on a Tomcat-Server!


I read in Hubert Rabago mail:
> Just as I suspected.  I'm forced to use WSAD where I work, 
> and I've turned
> off a whole bunch of validations by it, including Struts.  It 
> complains of a
> lot of things that either it doesn't know about or it's just 
> plain wrong
> about.  Fortunately, I only have to run the app there, and 
> not have to do any
> serious coding with it.  My teammates aren't as fortunate, though.


And thought that this could be a way to solve my problem, but did 
not find the right spot to enabel the validation.



Greetings
Oliver




DAMM I allways thougt that using Java would enable me 
to create  a *.war fiel and run it on any Java-application Server! 



> Oliver,
> 
> What version of WSAD are you running? What problems are you having 
> specifically?
> 
> Validation is controlled through the menu option Window >> Preferences >> 
> Validation
> 
> Susan Bradeen
> 
> "Oliver Thiel" <[EMAIL PROTECTED]> wrote on 03/26/2004 08:09:34 AM:
> 
> > Hi,
> > 
> > 
> > I read that some of you had some problems to run 
> > Struts apps on WSAD and as I run into that problem
> > too i wanted to know how you solved it!
> > 
> > I as far as I understand some turned of different validations
> > including the on concerning Struts, but where couldn't 
> > fide the right place to do that!
> > 
> > And are their any outher traps that has to be solved?
> > 
> > 
> > 
> > Thank and have a nice weekend
> > Oliver
> > 
> > -- 
> > +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz 
> +++
> > 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz
> > 
> > 
> > -
> > 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]
> 

-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


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



RE: How does ActionForm data pass through container called form based login page?

2004-03-26 Thread Martin Alley
Well I've just simplified by login form  - plain html - no struts stuff
going on.

I've also simplified the filter so detects a fresh logon and starts a
session accordingly - no longer any redirecting to LoginAction.

However the critical behaviour is still the same - existingCustomerForm
- the one I need to survive the login process still ends up getting
trashed.

I'm wondering if I have to make every form (that might span a session
timeout) part of the login page so that it stays alive - this sounds
like a ridiculous solution.  Has anyone else got a solution?

Thanks
Martin

-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2004 09:41
To: [EMAIL PROTECTED]
Subject: How does ActionForm data pass through container called form
based login page?

Hi,

Suppose I've got a web based form that posts data to an action, and I
have that action protected by container form based authorization - how
does the ActionForm data get through.

I have a situation like this, and my ActionForm is empty after I've been
through the form-based login page.

One could say - stick the input form in the constrained area also, so
the login page doesn't come between the input form and the action that
processes it - but this is actually occurring when a session times out
whilst sitting at the input form.

Thanks
Martin




-
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: [OT] WSAD problems with Struts

2004-03-26 Thread Rouven Gehm
Which version of WSAD are you using ?
I don't have problems with 5.0 + updates or 5.1.

Rouven


- Original Message -
From: "Oliver Thiel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 26, 2004 2:09 PM
Subject: [OT] WSAD problems with Struts


> Hi,
>
>
> I read that some of you had some problems to run
> Struts apps on WSAD and as I run into that problem
> too i wanted to know how you solved it!
>
> I as far as I understand some turned of different validations
> including the on concerning Struts, but where couldn't
> fide the right place to do that!
>
> And are their any outher traps that has to be solved?
>
>
>
> Thank and have a nice weekend
> Oliver
>
> --
> +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
> 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz
>
>
> -
> 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: [OT] WSAD problems with Struts

2004-03-26 Thread Susan Bradeen
Oliver,

What version of WSAD are you running? What problems are you having 
specifically?

Validation is controlled through the menu option Window >> Preferences >> 
Validation

Susan Bradeen

"Oliver Thiel" <[EMAIL PROTECTED]> wrote on 03/26/2004 08:09:34 AM:

> Hi,
> 
> 
> I read that some of you had some problems to run 
> Struts apps on WSAD and as I run into that problem
> too i wanted to know how you solved it!
> 
> I as far as I understand some turned of different validations
> including the on concerning Struts, but where couldn't 
> fide the right place to do that!
> 
> And are their any outher traps that has to be solved?
> 
> 
> 
> Thank and have a nice weekend
> Oliver
> 
> -- 
> +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz 
+++
> 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz
> 
> 
> -
> 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: Pls help me in configuring common logger

2004-03-26 Thread sougata
Hi Van
I am not using simple logger.I am using apache's  commons logger.Pls le me
know how to do it
Thanks
Sougata

-Original Message-
From: Van Riper, Mike [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 12:38 PM
To: 'Struts Users Mailing List'
Subject: RE: Pls help me in configuring common logger


> -Original Message-
> From: sougata [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 9:15 PM
> To: Struts Users Mailing List
> Subject: Pls help me in configuring common logger
>
>
> Hi Guys
> I am facing a problem in configuration apaches common logger using
> weblogic8.1.I want to send all my log message to a perticular
> file.I am
> using Common logger for my logging message.How to configure
> Pls let me know

The simple logger that is included in the commons logging package doesn't
support logging to a file, just to the console. You need to understand that
it is primarily intended to provide the common logging API (the simple
logger is included just to get you started) and then you configure it to use
whatever logging facility under the covers that you want to. Most people use
log4j, but, you could also use the native logging support in JDK 1.4 or
greater.

I recommend configuring to use log4j. I also recommend taking the time to
read the short intro manual to log4j found here:

http://tinyurl.com/3hlrq

I recently posted the contents of a simple log4j configuration file that
does have an example of the necessary configuration to write log messages
both to the console and to file. Check the list archives for a recent post
on logging by me. I use this setup with Tomcat and Weblogic. The one
configuration difference I found is that Weblogic doesn't like relative file
paths for location of log files and Tomcat handles that just fine.

Good luck, Van

Mike "Van" Riper
Silicon Valley Struts User Group
http://www.baychi.org/bof/struts/

P.S. You can either remove the commons logging properties file or explicitly
configure it to use log4j. As long as you setup log4j properly in your
runtime environment, the commons logging logic will use it by default unless
you have a commons logging properties file that explicitly specifies a
different logger implementation.

> Thanks
> Sougata

-
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: Handling Date objects in ActionForm gracefully

2004-03-26 Thread Freddy Villalba Arias
Cool!

No offence, Mark. In part, it's my fault since English is not my native
tongue and sometimes the same word translated into other language
changes the connotation of a phrase. Sh*t happens! :)

I believe yours is a valid approach (in fact, was one of the options I
was considering for the project we're about to begin). In any case, I'd
appreciate if you or anybody else would share any other views / opinions
about this issue (s) -- or any other related...

Peace, and thanx again everybody.
Freddy.

-Mensaje original-
De: Mark Lowe [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 26 de marzo de 2004 11:05
Para: Struts Users Mailing List
Asunto: Re: Handling Date objects in ActionForm gracefully

Freddy. No, you misunderstood if you thought I was responding with any 
hostility whatsoever.

There is a general problem where input would be better validated in the 
web tier so it can be decoupled from the model. So times comparing two 
dates would be useful and so on. But i think its also try to say that 
using anything but strings for user input will lead to problems.

And my suggestion could well be incorrect, I was putting it out there 
to see what response it would provoke.

Cheers Mark

On 26 Mar 2004, at 10:51, Freddy Villalba Arias wrote:

> Mark, didn't mean to be pedantic... just wanted to prevent everybody
> from going through all the (obvious / basic / simple) details and just
> go to the "important" stuff. Neither am I an MVC guru.
>
> In any case, thanx everybody 4 your help.
>
> Regards,
> Freddy.
>
>
> -Mensaje original-
> De: Mark Lowe [mailto:[EMAIL PROTECTED]
> Enviado el: viernes, 26 de marzo de 2004 10:24
> Para: Struts Users Mailing List
> Asunto: Re: Handling Date objects in ActionForm gracefully
>
> I think the way of going about converting is pretty open, either have
> some conversion utils between the web tier and the model. I tend to do
> it in the action and then when things get long or i need the code
again
> move it out into  a util class or like you're saying make my model
util
> classes deal with strings (this makes a lot of sense as then other
> front ends can be plugged on).
>
> Talk of MVC aside (after all MVC is a broader issue than the
particular
> pattern that struts is based on) why piss about dealing with all sorts
> of errors and exceptions being thrown in the place where its hardest
to
> deal with them?
>
> You can and people do use different types for form beans, but I just
> don't see the point. Date comes up often and lets face it dates are
> more user friendly as dropdown menus rather than free text, so
> getDay() , getMonth() and getYear() IMO are a simpler way of going
> about things. Then have methods in you model that create a date based
> on that, or have a util class in the web tier as you can deal with
> validating the three values. Perhaps even have a date that's in you
> form bean but is set and got (passed participle of get) via string
> flavors day, month and year.
>
> Not sure if this works but I think the idea is valid (corrections
> welcome).
>
> public class SomeForm extends ActionForm {
>
>   private Calendar aDate = Calender.instance();
>
>   public String getDay() {
>   int d = aDate.get(Calendar. DAY_OF_MONTH);
>   return Integer.toString(d);
>   }
>
>   public void setDay(String day) {
>   aDate.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day));
>   }
>   ...
>   protected Date getAdate() {
>   return dDate.getTime();
>   }
> }
>
> This way come checking and comparing values before can be done, before
> passing anything up to you model. Many folk would say that this should
> be done in the model, but i'd say situations where you need to check
if
> a user has entered a valid date (e.g. expire and from dates with a
> credit card).
>
> This functionality will want to be produced even if you change the
> model , if you wanted to demo your web tier on its own (without a
model
> e.g acme ltd credit card form)  and therefore doing it ONLY in the
> model would be limited.
>
> Very much IMO and I'm not MVC guru, but that's my understanding.
>
> On 26 Mar 2004, at 09:43, Freddy Villalba Arias wrote:
>
>> As someone with good experience in MVC-based applications but a
newbie
>> to Struts, what I understand from this discussion is that the
>> "recommended" implementation would have to comply, at least, with
this
>> "guidelines":
>>
>> - The conversion code is encapsulated in a separate class (I suppose
>> one
>> "converter" class per each  combination
>> required, right?).
>>
>> - Pa

Re: Handling Date objects in ActionForm gracefully

2004-03-26 Thread Mark Lowe
Freddy. No, you misunderstood if you thought I was responding with any 
hostility whatsoever.

There is a general problem where input would be better validated in the 
web tier so it can be decoupled from the model. So times comparing two 
dates would be useful and so on. But i think its also try to say that 
using anything but strings for user input will lead to problems.

And my suggestion could well be incorrect, I was putting it out there 
to see what response it would provoke.

Cheers Mark

On 26 Mar 2004, at 10:51, Freddy Villalba Arias wrote:

Mark, didn't mean to be pedantic... just wanted to prevent everybody
from going through all the (obvious / basic / simple) details and just
go to the "important" stuff. Neither am I an MVC guru.
In any case, thanx everybody 4 your help.

Regards,
Freddy.
-Mensaje original-
De: Mark Lowe [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 26 de marzo de 2004 10:24
Para: Struts Users Mailing List
Asunto: Re: Handling Date objects in ActionForm gracefully
I think the way of going about converting is pretty open, either have
some conversion utils between the web tier and the model. I tend to do
it in the action and then when things get long or i need the code again
move it out into  a util class or like you're saying make my model util
classes deal with strings (this makes a lot of sense as then other
front ends can be plugged on).
Talk of MVC aside (after all MVC is a broader issue than the particular
pattern that struts is based on) why piss about dealing with all sorts
of errors and exceptions being thrown in the place where its hardest to
deal with them?
You can and people do use different types for form beans, but I just
don't see the point. Date comes up often and lets face it dates are
more user friendly as dropdown menus rather than free text, so
getDay() , getMonth() and getYear() IMO are a simpler way of going
about things. Then have methods in you model that create a date based
on that, or have a util class in the web tier as you can deal with
validating the three values. Perhaps even have a date that's in you
form bean but is set and got (passed participle of get) via string
flavors day, month and year.
Not sure if this works but I think the idea is valid (corrections
welcome).
public class SomeForm extends ActionForm {

	private Calendar aDate = Calender.instance();

public String getDay() {
int d = aDate.get(Calendar. DAY_OF_MONTH);
return Integer.toString(d);
}
public void setDay(String day) {
aDate.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day));
}
...
protected Date getAdate() {
return dDate.getTime();
}
}
This way come checking and comparing values before can be done, before
passing anything up to you model. Many folk would say that this should
be done in the model, but i'd say situations where you need to check if
a user has entered a valid date (e.g. expire and from dates with a
credit card).
This functionality will want to be produced even if you change the
model , if you wanted to demo your web tier on its own (without a model
e.g acme ltd credit card form)  and therefore doing it ONLY in the
model would be limited.
Very much IMO and I'm not MVC guru, but that's my understanding.

On 26 Mar 2004, at 09:43, Freddy Villalba Arias wrote:

As someone with good experience in MVC-based applications but a newbie
to Struts, what I understand from this discussion is that the
"recommended" implementation would have to comply, at least, with this
"guidelines":
- The conversion code is encapsulated in a separate class (I suppose
one
"converter" class per each  combination
required, right?).
- Passes all (String) parameters to a Business Object that
encapsulates
the use case (I mean, the logic) and, from within that BO, use the
corresponding converter classes for getting the "actual" data object
to
flow around (i.e. be eventually get-ed or set-ed from the DAOs/DTOs,
bla
bla bla...)
I'm I right here or am I missing any other IMPORTANT aspect(s)?

STILL, there is something I don't get: how would you implement /
encapsulate then the opposite direction for data conversion; in other
words:
- Convert from "original" data types towards String (another method in
the same converter class?)
- Map (set) some (non-String) data object into the corresponding
String
property on the form bean.

Thanks,
Freddy.
-Mensaje original-
De: Mark Lowe [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 26 de marzo de 2004 0:59
Para: Sreenivasa Chadalavada; Struts Users Mailing List
Asunto: Re: Handling Date objects in ActionForm gracefully
You deal with the conversion else where but not in the form bean, you
can argue about it or just believe me. The action form sits between
the
view and the action, the date conversion goes on between the action
and
t

Re: i18n with Japanese characters and tags....

2004-03-26 Thread atchy
Thank you for your assist, Mr. Jason
(B
(BJason Lea <[EMAIL PROTECTED]> wrote:
(B
(B> He was saying it 'can' display Japanese characters. The example doesn't
(B> have any Japanese characters in in (if i remember correctly), but if
(B> they are put into the properties files for the locale they will be
(B> displayed.
(B
(BYep. The example app was written as a good example for i18n, so it does 
(Bnot contain any language specific characters directly in the JSPs to 
(Bshare a JSP with many languages.
(BThe messages resource files contain them.
(B
(B
(B> You should look into that http://www.anassina.com/struts/i18n/i18n.html
(B> page as it explains a lot.
(B> 
(B> I think the main problem is you have the Japanese characters already
(B> converted into HTML in your application as yuo have them in the format
(B> ハ. When you use a bean to write it out, the bean tried to escape
(B> any characters that are significant to HTML, and the '&' character is
(B> one of them. That is why it replaces your '&' with '&'. The bean is
(B> trying to help by displaying the text you provided in HTML so that it
(B> will appear as ハ on the page. The 'filter=false' stops it doing
(B> this, but also means if you have some other characters like '<' in your
(B> text then they won't be escaped and could cause the page to be rendered
(B> incorrectly.
(B
(Bcarlo,
(BThe behavior of bean:write is correct and proper.
(B
(BWhen you write Japanese in your message resource files, you should not 
(Buse the HTML numeric character 
(Breferences(http://www.w3.org/TR/html401/charset.html#h-5.3.1).
(BOr if you insist on using &#x, set filter=false.
(B
(B
(BAs I and Jason said, the most common way is, write Japanese characters 
(Binto message resource files directly (using a text editor and input 
(Bmethod that can handle Japanese) and convert using native2ascii.
(B
(B
(B
(B> When I display Japanese characters on my pages I store them in Japanese
(B> in a .properties file, then use native2ascii to convert those japanese
(B> characters into the Java Unicode properties file format of \u. When
(B> java reads them in, the actual unicode character is passed around in
(B> java and output directly into the html page. The page encoding is set to
(B> UTF-8, and the browser can display it correctly. The bean:write will
(B> also still escape the characters that need it such as '&' and '<'. This
(B> also means I am not dealing with HTML formatting inside my Java code,
(B> and can happily store the same characters in files, databases etc or
(B> output to another device instead of HTML.
(B> 
(B> -- 
(B> Jason Lea
(B> 
(B> 
(B> 
(B> carlo latasa wrote:
(B> 
(B> >I just checked the example application and did not see anything on Japanese 
(B> >characters. I'm at:
(B> >http://localhost:8080/struts-example/tour.do
(B
(BStruts try to choose language encoding according to your browser setting.
(BSo if you are not in Japanese environment, you should change your 
(Bbrowser language.
(B
(BSee 
(B 5. Test it out using a browser that let's you select default languages: 
(Bof
(B http://www.anassina.com/struts/i18n/i18n.html
(B
(BIn this case, you should choose "Japanese[ja]".
(BThen you will see Japanese characters (if your browser has suitable 
(Bfonts).
(B
(B
(BGood luck!
(B
(B
(B
(BYoshinori Ashizawa
(B
(B
(B> >
(B> >Did you mean that if I were to just take this code and modify it to display 
(B> >these characters? Or is the example somewhere else?
(B> >
(B> >
(B> >  
(B> >
(B> >>From: <[EMAIL PROTECTED]>
(B> >>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
(B> >>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
(B> >>Subject: Re: i18n with Japanese characters and tags
(B> >>Date: Tue, 23 Mar 2004 16:12:20 +0900
(B> >>
(B> >>Carlo,
(B> >>
(B> >>Have you checked the example application included in Struts1.1(or
(B> >>current CVS)? It can show Japanese characters correctly without any
(B> >>special implementations.
(B> >>I think it will be a help for your problem.
(B> >>
(B> >>The most frequent mistake in such case is lack of unicode escape
(B> >>to their message resource files.
(B> >>Don't forget "native2ascii" when you make your resource files.
(B> >>
(B> >>see also : http://www.anassina.com/struts/i18n/i18n.html
(B> >>
(B> >>
(B> >>Yoshinori Ashizawa
(B> >>Ja-Jakarta Project  www.j

RE: Handling Date objects in ActionForm gracefully

2004-03-26 Thread Freddy Villalba Arias
Mark, didn't mean to be pedantic... just wanted to prevent everybody
from going through all the (obvious / basic / simple) details and just
go to the "important" stuff. Neither am I an MVC guru.

In any case, thanx everybody 4 your help.

Regards,
Freddy.


-Mensaje original-
De: Mark Lowe [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 26 de marzo de 2004 10:24
Para: Struts Users Mailing List
Asunto: Re: Handling Date objects in ActionForm gracefully

I think the way of going about converting is pretty open, either have 
some conversion utils between the web tier and the model. I tend to do 
it in the action and then when things get long or i need the code again 
move it out into  a util class or like you're saying make my model util 
classes deal with strings (this makes a lot of sense as then other 
front ends can be plugged on).

Talk of MVC aside (after all MVC is a broader issue than the particular 
pattern that struts is based on) why piss about dealing with all sorts 
of errors and exceptions being thrown in the place where its hardest to 
deal with them?

You can and people do use different types for form beans, but I just 
don't see the point. Date comes up often and lets face it dates are 
more user friendly as dropdown menus rather than free text, so  
getDay() , getMonth() and getYear() IMO are a simpler way of going 
about things. Then have methods in you model that create a date based 
on that, or have a util class in the web tier as you can deal with 
validating the three values. Perhaps even have a date that's in you 
form bean but is set and got (passed participle of get) via string 
flavors day, month and year.

Not sure if this works but I think the idea is valid (corrections 
welcome).

public class SomeForm extends ActionForm {

private Calendar aDate = Calender.instance();

public String getDay() {
int d = aDate.get(Calendar. DAY_OF_MONTH);
return Integer.toString(d);
}

public void setDay(String day) {
aDate.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day));
}
...
protected Date getAdate() {
return dDate.getTime();
}
}

This way come checking and comparing values before can be done, before 
passing anything up to you model. Many folk would say that this should 
be done in the model, but i'd say situations where you need to check if 
a user has entered a valid date (e.g. expire and from dates with a 
credit card).

This functionality will want to be produced even if you change the 
model , if you wanted to demo your web tier on its own (without a model 
e.g acme ltd credit card form)  and therefore doing it ONLY in the 
model would be limited.

Very much IMO and I'm not MVC guru, but that's my understanding.

On 26 Mar 2004, at 09:43, Freddy Villalba Arias wrote:

> As someone with good experience in MVC-based applications but a newbie
> to Struts, what I understand from this discussion is that the
> "recommended" implementation would have to comply, at least, with this
> "guidelines":
>
> - The conversion code is encapsulated in a separate class (I suppose 
> one
> "converter" class per each  combination
> required, right?).
>
> - Passes all (String) parameters to a Business Object that
encapsulates
> the use case (I mean, the logic) and, from within that BO, use the
> corresponding converter classes for getting the "actual" data object
to
> flow around (i.e. be eventually get-ed or set-ed from the DAOs/DTOs, 
> bla
> bla bla...)
>
> I'm I right here or am I missing any other IMPORTANT aspect(s)?
>
> STILL, there is something I don't get: how would you implement /
> encapsulate then the opposite direction for data conversion; in other
> words:
>
> - Convert from "original" data types towards String (another method in
> the same converter class?)
>
> - Map (set) some (non-String) data object into the corresponding
String
> property on the form bean.
>
> Thanks,
> Freddy.
>
> -Mensaje original-
> De: Mark Lowe [mailto:[EMAIL PROTECTED]
> Enviado el: viernes, 26 de marzo de 2004 0:59
> Para: Sreenivasa Chadalavada; Struts Users Mailing List
> Asunto: Re: Handling Date objects in ActionForm gracefully
>
> You deal with the conversion else where but not in the form bean, you
> can argue about it or just believe me. The action form sits between
the
>
> view and the action, the date conversion goes on between the action
and
>
> the model.
>
> Your approach isn't that bad its just not to the MVC pattern that
> struts follows (not that its the only one).
>
> Create a date convertion util class or something.
>
> If you dont want to take my word for it here's what craig had to say
>

RE: Handling Date objects in ActionForm gracefully

2004-03-26 Thread Joe Hertz

Since I just wrestled greatly with this particular beast, my $.02 follows.

Subclass whatever flavor of ActionForm you use, and give it a method with a 
footprint like-

java.util.Date StringToDate(String) 
{
}

This way you can do something like this in your action:

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
  Myform mf = (Myform) form;
  BizObject bo = new BizObject();
  String dateText = mf.getDateString();
  bo.setDate(mf.StringToDate(dateText);
  // etc
}

This works very well unless internationalizing your app because the converter 
needs a DateFormat defined to read the String correctly. And I am, so I need 
to come up with something.

I don't suppose there is a version of BeanUtils that lets the user pass a 
DateFormat into copyProperties :-)???

-Joe


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 26, 2004 3:58 AM
> To: Struts Users Mailing List
> Subject: RE: Handling Date objects in ActionForm gracefully
> 
> 
> 
> 
> +1
> I also suggest this approach to keep the date as string 
> during posts and convert them to date object when porcessing 
> the entered dates, surely not in the Form.
> 
> Depends on  what you really want to achieve. Would suggest 
> the KISS rule..:-)
> 
> 
> 
> 
> 
> "Robert Taylor" <[EMAIL PROTECTED]> on 03/25/2004 08:53:31 PM
> 
> Please respond to "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> 
> To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc:(bcc: Anuj Upadhyay/Jeppesen/TMC)
> 
> Subject:  RE: Handling Date objects in ActionForm gracefully
> 
> 
> 
> +1
> 
> > -Original Message-
> > From: Mark Lowe [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 25, 2004 2:36 PM
> > To: Struts Users Mailing List
> > Subject: Re: Handling Date objects in ActionForm gracefully
> >
> >
> > Have it as a string and convert it to a date or calendar 
> when you pass 
> > it back to the model.
> >
> >
> > On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:
> >
> > > All,
> > >
> > > We are facing a problem when we define java.util.Date field in 
> > > ActionForm.
> > >
> > > Is there any way to override the default behavior provided by 
> > > Struts?
> > >
> > > I very much appreciate your help!!
> > >
> > > Thanks and Regards,
> > > Sree/-
> > >
> > >
> > > 
> 
> > > ---
> > > -
> > > This is a PRIVATE message. If you are not the intended recipient,
> > > please
> > > delete without copying and kindly advise us by e-mail of 
> the mistake in
> > > delivery. NOTE: Regardless of content, this e-mail shall 
> not operate to
> > > bind CSC to any order or other contract unless pursuant 
> to explicit
> > > written agreement or government initiative expressly 
> permitting the
> > > use of
> > > e-mail for such purpose.
> > > 
> --
> -
> > > -
> >
> >
> > 
> -
> > 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]
> 
> 
> 

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



RE: problem with module

2004-03-26 Thread Colm Garvey
I've just finished fixing what I think is the same problem you guys have
been
having i.e. switching modules on Struts 1.1

First, make sure you have the most recent release build of struts, as I had
problems
with earler 1.1 builds on weblogic 8.1

I originally started with the simple-module-switching application to get
things going and I
had to make a few modifications to get it working.

You can download it from http://www.garvey.ie/struts/multimod.zip and
hopefully you will be
able to spot where things are going wrong.

Hope this helps,

Colm

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: 25 March 2004 15:22
To: Struts Users Mailing List
Subject: Re: problem with module


Daniel wrote:

>If someone know the solution help us..
>
>
>- Original Message -
>From: "Daniel" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Thursday, March 25, 2004 11:01 AM
>Subject: Re: problem with module
>
>
>
>
>>Hi I have the the same problem, but in other situation, I using popups
>>windows of other modules, if you find the solution tell me , if I find the
>>solution I tell you...
>>
>>- Original Message -
>>From: "ruben" <[EMAIL PROTECTED]>
>>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>Sent: Thursday, March 25, 2004 6:19 AM
>>Subject: problem with module
>>
>>
>>
>>
>>>hi everybody, excuse me for my english,
>>>that is the scenario,
>>> i've got 2 modules, default and mod1, i call from mod1 an action that
>>>load a page with  2 iframes, that load a page resource, these resources
>>>are in the /page context, struts add /mod1 to the context, and i have to
>>>use a SwitchAction. My problem is when load a form that is in the page
>>>resource,i've got a ServletException: Cannot retrieve mapping for action
>>>/GestionUbicacion,
>>>i try to prepend /mod1 but i've got the same error, does anybody know
>>>the way to slove this?
>>>thanks a lot.
>>>
>>>
>>>
>>>
>>>-
>>>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]
>
>
>
hi, i solve this. I do the next thing that i found in the archives ...

http://www.mail-archive.com/[EMAIL PROTECTED]/msg96007.html

i change the module before call the page, and it seems to work in this
scenario,





-
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: Handling Date objects in ActionForm gracefully

2004-03-26 Thread Mark Lowe
I think the way of going about converting is pretty open, either have 
some conversion utils between the web tier and the model. I tend to do 
it in the action and then when things get long or i need the code again 
move it out into  a util class or like you're saying make my model util 
classes deal with strings (this makes a lot of sense as then other 
front ends can be plugged on).

Talk of MVC aside (after all MVC is a broader issue than the particular 
pattern that struts is based on) why piss about dealing with all sorts 
of errors and exceptions being thrown in the place where its hardest to 
deal with them?

You can and people do use different types for form beans, but I just 
don't see the point. Date comes up often and lets face it dates are 
more user friendly as dropdown menus rather than free text, so  
getDay() , getMonth() and getYear() IMO are a simpler way of going 
about things. Then have methods in you model that create a date based 
on that, or have a util class in the web tier as you can deal with 
validating the three values. Perhaps even have a date that's in you 
form bean but is set and got (passed participle of get) via string 
flavors day, month and year.

Not sure if this works but I think the idea is valid (corrections 
welcome).

public class SomeForm extends ActionForm {

	private Calendar aDate = Calender.instance();

public String getDay() {
int d = aDate.get(Calendar. DAY_OF_MONTH);
return Integer.toString(d);
}
public void setDay(String day) {
aDate.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day));
}
...
protected Date getAdate() {
return dDate.getTime();
}
}
This way come checking and comparing values before can be done, before 
passing anything up to you model. Many folk would say that this should 
be done in the model, but i'd say situations where you need to check if 
a user has entered a valid date (e.g. expire and from dates with a 
credit card).

This functionality will want to be produced even if you change the 
model , if you wanted to demo your web tier on its own (without a model 
e.g acme ltd credit card form)  and therefore doing it ONLY in the 
model would be limited.

Very much IMO and I'm not MVC guru, but that's my understanding.

On 26 Mar 2004, at 09:43, Freddy Villalba Arias wrote:

As someone with good experience in MVC-based applications but a newbie
to Struts, what I understand from this discussion is that the
"recommended" implementation would have to comply, at least, with this
"guidelines":
- The conversion code is encapsulated in a separate class (I suppose 
one
"converter" class per each  combination
required, right?).

- Passes all (String) parameters to a Business Object that encapsulates
the use case (I mean, the logic) and, from within that BO, use the
corresponding converter classes for getting the "actual" data object to
flow around (i.e. be eventually get-ed or set-ed from the DAOs/DTOs, 
bla
bla bla...)

I'm I right here or am I missing any other IMPORTANT aspect(s)?

STILL, there is something I don't get: how would you implement /
encapsulate then the opposite direction for data conversion; in other
words:
- Convert from "original" data types towards String (another method in
the same converter class?)
- Map (set) some (non-String) data object into the corresponding String
property on the form bean.
Thanks,
Freddy.
-Mensaje original-
De: Mark Lowe [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 26 de marzo de 2004 0:59
Para: Sreenivasa Chadalavada; Struts Users Mailing List
Asunto: Re: Handling Date objects in ActionForm gracefully
You deal with the conversion else where but not in the form bean, you
can argue about it or just believe me. The action form sits between the
view and the action, the date conversion goes on between the action and

the model.

Your approach isn't that bad its just not to the MVC pattern that
struts follows (not that its the only one).
Create a date convertion util class or something.

If you dont want to take my word for it here's what craig had to say
albeit in response to a different question

As the original designer of Struts :-), I must point out that the
design of
ActionForm (and the recommendation that form bean properties be
Strings) is
***very*** deliberate.  The reason this is needed is obvious when you
consider
the following use case:
* You have an input form that, say, accepts only integers.

* Your form bean property is of type "int".

* The user types "1b3" instead of "123", by accident.

* Based on experience with any garden variety GUI application,
   the user will expect that they receive an error message,
   plus a redisplay of the form ***WITH THE INCORRECT VALUES
   THAT WERE ENTERED DISPLAYED SO THE USER CAN CORRECT THEM***.
* Th

Re: html inside an action

2004-03-26 Thread ruben
Hi,
thanks everybody for the responses, they help us a lot to make a 
decision, i think that it could be better solution trying to do my 
requirements with tags , but i need that an import could load a resource 
dinamycally, something like these 



and SomeVariable has a String with the name of the resource,
is this possible? i try to do but it doesn't work ...
thanks a lot,
Brendan Richards wrote:

There's also jakarkta commons-httpclient

http://jakarta.apache.org/commons/httpclient/

-Original Message-
From: Qureshi, Affan [mailto:[EMAIL PROTECTED] 
Sent: 25 March 2004 17:04
To: Struts Users Mailing List
Subject: RE: html inside an action

HttpUnit is also a neat tool which might help. Have a JSP generate the
HTML and access that using HttpUnit (or a simple URLConnection/Socket
for that matter). And you can get the generated HTML in your Action. 

I hope I understand you this time.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:54 AM
To: Struts Users Mailing List
Subject: Re: html inside an action
hi
Those are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on my 
action , is it possible? thanks a lot ,
Regards.

Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally you 
shouldn't be doing any client-side stuff in your Actions.
A cleaner approach would be to use Custom Tags to have the HTML 
generation code and you can call them from your JSPs. (Remember that 
JSPs are not sent to the browser, it is the code they generate that is 
sent to the client browser).
Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action
Qureshi, Affan wrote:



 

What part of JSP do you want to generate? Is it Java code in the JSP 
that you want to generate or static HTML/JavaScript? You might want to
   

 

look at Tag Libraries as well.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:00 AM
To: Struts Users Mailing List
Subject: html inside an action
hi!
how can i get the output generate in a .jsp inside an action like it 
was a resource that i can process(a String or something else)???
thanks a lot in advance.

PD: I need to call jasper compiler or something similar? what can i do
   

 

that? thanks

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


 
   

hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot

-
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]
-
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: Handling Date objects in ActionForm gracefully

2004-03-26 Thread anuj . upadhyay


+1
I also suggest this approach to keep the date as string during posts and convert
them to date object when porcessing the entered dates, surely not in the Form.

Depends on  what you really want to achieve. Would suggest the KISS rule..:-)





"Robert Taylor" <[EMAIL PROTECTED]> on 03/25/2004 08:53:31 PM

Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:    (bcc: Anuj Upadhyay/Jeppesen/TMC)

Subject:  RE: Handling Date objects in ActionForm gracefully



+1

> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 2:36 PM
> To: Struts Users Mailing List
> Subject: Re: Handling Date objects in ActionForm gracefully
>
>
> Have it as a string and convert it to a date or calendar when you pass
> it back to the model.
>
>
> On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:
>
> > All,
> >
> > We are facing a problem when we define java.util.Date field in
> > ActionForm.
> >
> > Is there any way to override the default behavior provided by Struts?
> >
> > I very much appreciate your help!!
> >
> > Thanks and Regards,
> > Sree/-
> >
> >
> > ---
> > -
> > This is a PRIVATE message. If you are not the intended recipient,
> > please
> > delete without copying and kindly advise us by e-mail of the mistake in
> > delivery. NOTE: Regardless of content, this e-mail shall not operate to
> > bind CSC to any order or other contract unless pursuant to explicit
> > written agreement or government initiative expressly permitting the
> > use of
> > e-mail for such purpose.
> > ---
> > -
>
>
> -
> 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: Handling Date objects in ActionForm gracefully

2004-03-26 Thread Freddy Villalba Arias
As someone with good experience in MVC-based applications but a newbie
to Struts, what I understand from this discussion is that the
"recommended" implementation would have to comply, at least, with this
"guidelines":

- The conversion code is encapsulated in a separate class (I suppose one
"converter" class per each  combination
required, right?).

- Passes all (String) parameters to a Business Object that encapsulates
the use case (I mean, the logic) and, from within that BO, use the
corresponding converter classes for getting the "actual" data object to
flow around (i.e. be eventually get-ed or set-ed from the DAOs/DTOs, bla
bla bla...)

I'm I right here or am I missing any other IMPORTANT aspect(s)?

STILL, there is something I don't get: how would you implement /
encapsulate then the opposite direction for data conversion; in other
words:

- Convert from "original" data types towards String (another method in
the same converter class?)

- Map (set) some (non-String) data object into the corresponding String
property on the form bean.

Thanks,
Freddy.

-Mensaje original-
De: Mark Lowe [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 26 de marzo de 2004 0:59
Para: Sreenivasa Chadalavada; Struts Users Mailing List
Asunto: Re: Handling Date objects in ActionForm gracefully

You deal with the conversion else where but not in the form bean, you  
can argue about it or just believe me. The action form sits between the

view and the action, the date conversion goes on between the action and

the model.

Your approach isn't that bad its just not to the MVC pattern that  
struts follows (not that its the only one).

Create a date convertion util class or something.

If you dont want to take my word for it here's what craig had to say  
albeit in response to a different question


As the original designer of Struts :-), I must point out that the  
design of
ActionForm (and the recommendation that form bean properties be  
Strings) is
***very*** deliberate.  The reason this is needed is obvious when you  
consider
the following use case:

* You have an input form that, say, accepts only integers.

* Your form bean property is of type "int".

* The user types "1b3" instead of "123", by accident.

* Based on experience with any garden variety GUI application,
   the user will expect that they receive an error message,
   plus a redisplay of the form ***WITH THE INCORRECT VALUES
   THAT WERE ENTERED DISPLAYED SO THE USER CAN CORRECT THEM***.

* The current Struts environment will throw an exception
   due to the conversion failure.

* The suggested solution will ***hopelessly*** confuse the
   nature of a form bean, which is part of the VIEW tier, with
   model beans that have native data types.

Struts does not include any sort of "user interface component model"  
where the
details of conversion are hidden inside the user interface component.   
If that
is what you are after, you should look at a *real* user interface  
component
model (such as using JavaServer Faces with a Struts application).   
Corrupting
the functionality of a form bean to *pretend* that it is a user  
interface
component is only going to create complications for the world.


I hope this helps

Mark

On 25 Mar 2004, at 21:26, Sreenivasa Chadalavada wrote:

>
> Application Tier is strongly typed.
>
> So if the field is a java.util.Date in the database, then the data  
> object will have the method
>
> public DataObject{
>         public java.util.Date getAsOfDate()
>         public void setAsOfDate(java.util.Date asOfDate) methods.
> }
>
> My Action form is:
>
> public MyActionForm extends ActionForm{
>         public DataObject getDataObject();
>         public void setDataObject(DataObject dataObject);
> }
>
> My jsp contains
>
> 
>
> This will fail if the user does not enter any date. I want the  
> (changed) struts framework to handle that.
>
> I did not want to create a new method with type String for every Date

> field
>
> Hope this explanation helps !!
>
> Thanks and Regards,
>  Sree/-
>
>
>   
>
--- 
> -
>  This is a PRIVATE message. If you are not the intended recipient,  
> please delete without copying and kindly advise us by e-mail of the  
> mistake in delivery. NOTE: Regardless of content, this e-mail shall  
> not operate to bind CSC to any order or other contract unless pursuant

> to explicit written agreement or government initiative expressly  
> permitting the use of e-mail for such purpose.
>   
>
--- 
> -----
>
>
>
>
>
> Mark Lowe   @boxstuff.com>
>
> 03/25/2004 03:17 PM
> Please

Re: Struts tag problem (bean:message and bean:write)

2004-03-26 Thread Dmitrii CRETU
Hello Marco,

maybe this will help (using struts-el):




Dima.


Thursday, March 25, 2004, 6:02:54 PM, you wrote:

MM> Hi all,
MM> I was wondering if anyone of you have a solution
MM> For this dilemma.
MM> I have a collectin of product DTOs to show on my jsp. One of 
MM> DTO's property is, let's say, the type, which is listed in number.
MM> (let's say, 10 or 20).
MM> ON the DTO I will have the value 10,20 ecc but on the jsp I have to
MM> display
MM> The corresponding string (let's say, HouseProduct or Car or something
MM> else) which is listed in application.resources.

MM> I am looping thru the collection using logic:iterate, and
MM> as I have found out myself, following code does not work

MM> 


MM> basically in app.resources I will have
MM> prompt.productType.10=HouseProduct
MM> prompt.productType.20=Car

MM> etc..

MM> above, I am outputting the message   prompt.productType.(productType)

MM> how can I solve my dilemma, keeping in mind that I am using also
MM> logic:iterate to loop thru the collection?

MM> With best regards
MM> marco


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



-- 
Best regards,
 Dmitriimailto:[EMAIL PROTECTED]



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



Any Takers ?RE: Struts Validator and Select boxes

2004-03-26 Thread Janarthan Sathiamurthy
Any help/takers ?

-Original Message-
From: Janarthan Sathiamurthy 
Sent: Thursday, March 25, 2004 10:16 PM
To: [EMAIL PROTECTED]
Subject: Struts Validator and Select boxes


Hi,

I am using Struts validator.
One page of mine has dates displayed as "MM"  "DD" "".
All the above 3 are displayed in seprate combo/select boxes.
I need to do some custom validations on these fields.
I wrote a custom class for the same 
Looks like - 
   public static boolean validateDates(Object bean,
ValidatorAction validatorAction,
Field field, ActionErrors errors,
HttpServletRequest request)
   {
  String actionType = ValidatorUtil.getValueAsString(bean,
 
field.getVarValue("actionType")); // A hidden form field
  String fromMonth = ValidatorUtil.getValueAsString(bean,
field.getProperty());
  String fromDay = ValidatorUtil.getValueAsString(bean,
  field.getVarValue("fromDay"));
  String fromYear = ValidatorUtil.getValueAsString(bean,
   field.getVarValue("fromYear"));
  String toMonth = ValidatorUtil.getValueAsString(bean,
  field.getVarValue("toMonth"));
  String toDay = ValidatorUtil.getValueAsString(bean,
field.getVarValue("toDay"));
  String toYear = ValidatorUtil.getValueAsString(bean,
 field.getVarValue("toYear"));

  System.out.println("actionType " + actionType);
  System.out.println("fromMonth " + fromMonth);
  System.out.println("fromDay " + fromDay);
  System.out.println("fromYear " + fromYear);
  System.out.println("toMonth " + toMonth);
  System.out.println("toDay " + toDay);
  System.out.println("toYear " + toYear);

  return true;
   }

O/P of the above code - 
actionType searchPage
fromMonth 2
fromDay null
fromYear null
toMonth null
toDay null
toYear null

It also gives me "No Name Specified error".
Point to note is that the all other fields other than 'actionType' are select boxes. 
It gives a null for all the field types that are of html:select.
Is this a known BUG or am i going wrong somewhere ? 


Error LOG -
Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil getValueAsString
SEVERE: No name specified
java.lang.IllegalArgumentException: No name specified
at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at 
org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.java:121)
at 
com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDateValidator.j
ava:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:454)
at org.apache.commons.validator.Validator.validateField(Validator.java:544)
at org.apache.commons.validator.Validator.validate(Validator.java:582)
at 
org.apache.struts.validator.DynaValidatorActionForm.validate(DynaValidatorActionForm.java
:125)
at 
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav
a:1053)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at 
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
ontext.java:6310)
at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:36
22)
at 
weblogic.servlet.internal.ServletRequest

RE: Using JSTL Instead of Nested Tags

2004-03-25 Thread Mike Duffy
Thanks Robert.

Your suggestion was helpful.

Another key is to use varStatus='status' and the corresponding ${status.index} to 
reference the
objects in the form array:

   
  
 
  

  


  

  
    

 
  

  
  

  
  


  


--- Robert Taylor <[EMAIL PROTECTED]> wrote:
> Mike, you will have to expose the form like:
> 
> 
> 
> ...where "myForm" is its name defined in the struts-config file.
> 
> If its DynaForm then you have to expose the form map:
> 
> 
> 
> Once you do this, you can use JSTL to access and render values:
> 
> 
> 
> or 
> 
> 
> 
> 
> robert
> 
> > -Original Message-
> > From: Mike Duffy [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 25, 2004 4:46 PM
> > To: Struts Users Mailing List
> > Subject: Using JSTL Instead of Nested Tags
> > 
> > 
> > I'm trying to convert an application from Struts display tags to JSTL (still using 
> > Struts as
> the
> > MVC).
> > 
> > I am having some difficulty converting nested tags to JSTL.
> > 
> > Can anyone offer any guidance?
> > 
> > Thanks.
> > 
> > Mike
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! Finance Tax Center - File online. File on time.
> > http://taxes.yahoo.com/filing.html
> > 
> > -
> > 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]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: Pls help me in configuring common logger

2004-03-25 Thread Rajat Pandit
i shall my two cents to this, do read the article on onlamp.com and go
though the source code as well. i just had to do the same this morning to
refresh my log4j skills.

- Original Message -
From: "Van Riper, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, March 26, 2004 12:37 PM
Subject: RE: Pls help me in configuring common logger


> > -Original Message-
> > From: sougata [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 25, 2004 9:15 PM
> > To: Struts Users Mailing List
> > Subject: Pls help me in configuring common logger
> >
> >
> > Hi Guys
> > I am facing a problem in configuration apaches common logger using
> > weblogic8.1.I want to send all my log message to a perticular
> > file.I am
> > using Common logger for my logging message.How to configure
> > Pls let me know
>
> The simple logger that is included in the commons logging package doesn't
> support logging to a file, just to the console. You need to understand
that
> it is primarily intended to provide the common logging API (the simple
> logger is included just to get you started) and then you configure it to
use
> whatever logging facility under the covers that you want to. Most people
use
> log4j, but, you could also use the native logging support in JDK 1.4 or
> greater.
>
> I recommend configuring to use log4j. I also recommend taking the time to
> read the short intro manual to log4j found here:
>
> http://tinyurl.com/3hlrq
>
> I recently posted the contents of a simple log4j configuration file that
> does have an example of the necessary configuration to write log messages
> both to the console and to file. Check the list archives for a recent post
> on logging by me. I use this setup with Tomcat and Weblogic. The one
> configuration difference I found is that Weblogic doesn't like relative
file
> paths for location of log files and Tomcat handles that just fine.
>
> Good luck, Van
>
> Mike "Van" Riper
> Silicon Valley Struts User Group
> http://www.baychi.org/bof/struts/
>
> P.S. You can either remove the commons logging properties file or
explicitly
> configure it to use log4j. As long as you setup log4j properly in your
> runtime environment, the commons logging logic will use it by default
unless
> you have a commons logging properties file that explicitly specifies a
> different logger implementation.
>
> > Thanks
> > Sougata
>
> -
> 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: Pls help me in configuring common logger

2004-03-25 Thread Van Riper, Mike
> -Original Message-
> From: sougata [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 9:15 PM
> To: Struts Users Mailing List
> Subject: Pls help me in configuring common logger
> 
> 
> Hi Guys
> I am facing a problem in configuration apaches common logger using
> weblogic8.1.I want to send all my log message to a perticular 
> file.I am
> using Common logger for my logging message.How to configure 
> Pls let me know

The simple logger that is included in the commons logging package doesn't
support logging to a file, just to the console. You need to understand that
it is primarily intended to provide the common logging API (the simple
logger is included just to get you started) and then you configure it to use
whatever logging facility under the covers that you want to. Most people use
log4j, but, you could also use the native logging support in JDK 1.4 or
greater.

I recommend configuring to use log4j. I also recommend taking the time to
read the short intro manual to log4j found here:

http://tinyurl.com/3hlrq

I recently posted the contents of a simple log4j configuration file that
does have an example of the necessary configuration to write log messages
both to the console and to file. Check the list archives for a recent post
on logging by me. I use this setup with Tomcat and Weblogic. The one
configuration difference I found is that Weblogic doesn't like relative file
paths for location of log files and Tomcat handles that just fine.

Good luck, Van

Mike "Van" Riper
Silicon Valley Struts User Group
http://www.baychi.org/bof/struts/

P.S. You can either remove the commons logging properties file or explicitly
configure it to use log4j. As long as you setup log4j properly in your
runtime environment, the commons logging logic will use it by default unless
you have a commons logging properties file that explicitly specifies a
different logger implementation.
 
> Thanks
> Sougata

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



RE: Calling Class Methods

2004-03-25 Thread Lokanath
hi
u can call the static method by first importing the class in 
<%@ page import = "package.*" %>
then use the static method 

Lokanath

-Original Message-
From: Sunny [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 8:55 PM
To: Struts Users Mailing List
Subject: Calling Class Methods


How can i invoke static methods of a Class without instantiating it in 
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: Tile Problem

2004-03-25 Thread Caroline Jen
Huraah!! 




worked.  I have been carrying this problem with me for
quite some time.  Finally got it.

--- Avinash Gangadharan <[EMAIL PROTECTED]>
wrote:
> Try the code below. This should work. 
> 
> [CODE]
> .
> <%@ taglib uri="/WEB-INF/lib/struts-bean.tld"
> prefix="bean" %>
> 
> 
> 
> .
> 
> 
> 
> 
> 
> 
> 
> 
> 
> .
> [/CODE]
> 
> -Original Message-
> From: Caroline Jen [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 25, 2004 4:52 PM
> To: Struts Users Mailing List
> Subject: Re: Tile Problem
> 
> 
> I followed your suggestion.  Now, when I ran my
> application, I got 
> 
> article.Main.title???en_US.??? 
> 
> displayed in the browser.  Still, cannot pick up the
> 
> article.Menu.title=Registered Members
> 
> in the application.properties (which is located in
> the
> ApplicationRoot/WEB-INF/classes/resources folder).
> 
> Here is my code:
> 
> [CODE]
> .
> <%@ taglib uri="/WEB-INF/lib/struts-bean-el.tld"
> prefix="bean-el" %>
> 
> 
> 
> .
> 
> 
>  name="title"/> key="${titleKey}"/>
> 
> 
> 
> 
> 
> .
> [/CODE]
> 
> In my tiles-def.xml, I have:
> 
> [CODE]
> extends=".article.Base">
>value="article.Menu.title"/>
>value="/article/content/menu.jsp"/>
>value="/article/common/navbarMenu.jsp"/>
>
> [/CODE]
> 
> -Caroline
> 
> 
> --- Jason Lea <[EMAIL PROTECTED]> wrote:
> > Are you using the struts-el tags.  You might have
> > them installed as
> > bean-el in which case you would need to use
> > 
> >  > name="title"/> > key="${titleKey}"/>
> > 
> > I only use the EL tags, so I just use bean as the
> > tag prefix eg <%@
> > taglib uri="/WEB-INF/jsp/tags/struts-bean-el.tld"
> > prefix="bean" %>
> > 
> > 
> > 
> > Caroline Jen wrote:
> > 
> > >I tried both of your suggestions.  For example, I
> > have
> > >
> > >[code]
> > >.
> > >
> > > > >name="title"/> > >key="${titleKey}"/>
> > >
> > >
> > >
> > >
> > >
> > >.
> > >[/code]
> > >
> > >I got java.lang.IllegalArgumentException: can't
> > parse
> > >argument number titleKey
> > >
> > >--- Jason Lea <[EMAIL PROTECTED]> wrote:
> > >  
> > >
> > >>If you are using JSTL you can do this:
> > >>
> > >> > >>name="title"> > >>key="${titleKey}"/>
> > >>
> > >>if that doesn't work, try this:
> > >>
> > >> > >>name="title"/> > >>key="${titleKey}"/>
> > >>
> > >>
> > >>
> > >>Caroline Jen wrote:
> > >>
> > >>
> > >>
> > >>>In general, the tile works fine for me except
> the
> > >>>"title" piece.
> > >>> 
> > >>>[CODE]
> > >>>.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>.
> > >>>[/CODE]
> > >>>
> > >>>In my tiles-def.xml, I have:
> > >>>
> > >>>[CODE]
> > >>>   extends=".article.Base">
> > >>>  > >>>value="article.Menu.title"/>
> > >>>  > >>>value="/article/content/menu.jsp"/>
> > >>>  > >>>value="/article/common/navbarMenu.jsp"/>
> > >>>  
> > >>>[/CODE]
> > >>>
> > >>>The problem is that my application displays
> > >>>
> > >>>article.Menu.title
> > >>>
> > >>>in the browser, instead of going to the
> application.properties 
> > >>>(which is in the
> ApplicationRoot/WEB-INF/classes/resources folder)
> > >>>  
> > >>>
> > >>to
> > >>
> > >>
> > >>>get
> > >>>
> > >>>article.Menu.title=Registered Members
> > >>>
> > >>>What should I do?
> > >>>
> > >>>__
> > >>>Do you Yahoo!?
> > >>>Yahoo! Finance Tax Center - File online. File
> on
> > >>>  
> > >>>
> > >>time.
> > >>
> > >>
> > >>>http://taxes.yahoo.com/filing.html
> 
=== message truncated ===


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



RE: Tile Problem

2004-03-25 Thread Avinash Gangadharan
Try the code below. This should work. 

[CODE]
.
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean" %>



.









.
[/CODE]

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 25, 2004 4:52 PM
To: Struts Users Mailing List
Subject: Re: Tile Problem


I followed your suggestion.  Now, when I ran my
application, I got 

article.Main.title???en_US.??? 

displayed in the browser.  Still, cannot pick up the

article.Menu.title=Registered Members

in the application.properties (which is located in the
ApplicationRoot/WEB-INF/classes/resources folder).

Here is my code:

[CODE]
.
<%@ taglib uri="/WEB-INF/lib/struts-bean-el.tld"
prefix="bean-el" %>



.








.
[/CODE]

In my tiles-def.xml, I have:

[CODE]
   
  
  
  
   
[/CODE]

-Caroline


--- Jason Lea <[EMAIL PROTECTED]> wrote:
> Are you using the struts-el tags.  You might have
> them installed as
> bean-el in which case you would need to use
> 
>  name="title"/> key="${titleKey}"/>
> 
> I only use the EL tags, so I just use bean as the
> tag prefix eg <%@
> taglib uri="/WEB-INF/jsp/tags/struts-bean-el.tld"
> prefix="bean" %>
> 
> 
> 
> Caroline Jen wrote:
> 
> >I tried both of your suggestions.  For example, I
> have
> >
> >[code]
> >.
> >
> > >name="title"/> >key="${titleKey}"/>
> >
> >
> >
> >
> >
> >.
> >[/code]
> >
> >I got java.lang.IllegalArgumentException: can't
> parse
> >argument number titleKey
> >
> >--- Jason Lea <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>If you are using JSTL you can do this:
> >>
> >> >>name="title"> >>key="${titleKey}"/>
> >>
> >>if that doesn't work, try this:
> >>
> >> >>name="title"/> >>key="${titleKey}"/>
> >>
> >>
> >>
> >>Caroline Jen wrote:
> >>
> >>
> >>
> >>>In general, the tile works fine for me except the
> >>>"title" piece.
> >>> 
> >>>[CODE]
> >>>.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>.
> >>>[/CODE]
> >>>
> >>>In my tiles-def.xml, I have:
> >>>
> >>>[CODE]
> >>>  
> >>>  >>>value="article.Menu.title"/>
> >>>  >>>value="/article/content/menu.jsp"/>
> >>>  >>>value="/article/common/navbarMenu.jsp"/>
> >>>  
> >>>[/CODE]
> >>>
> >>>The problem is that my application displays
> >>>
> >>>article.Menu.title
> >>>
> >>>in the browser, instead of going to the application.properties 
> >>>(which is in the ApplicationRoot/WEB-INF/classes/resources folder)
> >>>  
> >>>
> >>to
> >>
> >>
> >>>get
> >>>
> >>>article.Menu.title=Registered Members
> >>>
> >>>What should I do?
> >>>
> >>>__
> >>>Do you Yahoo!?
> >>>Yahoo! Finance Tax Center - File online. File on
> >>>  
> >>>
> >>time.
> >>
> >>
> >>>http://taxes.yahoo.com/filing.html
> >>>
> >>>  
> >>>
>
>>-
> >>
> >>
> >>>To unsubscribe, e-mail:
> >>>  
> >>>
> >>[EMAIL PROTECTED]
> >>
> >>
> >>>For additional commands, e-mail:
> >>>  
> >>>
> >>[EMAIL PROTECTED]
> >>
> >>
> >>> 
> >>>
> >>>  
> >>>
> >>--
> >>Jason Lea
> >>
> >>
> >>
> >>
> >>
> >>
>
>-
> >  
> >
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail:
> >>[EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
> >__
> >Do you Yahoo!?
> >Yahoo! Finance Tax Center - File online. File on
> time.
> >http://taxes.yahoo.com/filing.html
> >
>
>-
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> 
> --
> Jason Lea
> 
> 
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

-
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: Tile Problem

2004-03-25 Thread Caroline Jen
I followed your suggestion.  Now, when I ran my
application, I got 

article.Main.title???en_US.??? 

displayed in the browser.  Still, cannot pick up the

article.Menu.title=Registered Members

in the application.properties (which is located in the
ApplicationRoot/WEB-INF/classes/resources folder).

Here is my code:

[CODE]
.
<%@ taglib uri="/WEB-INF/lib/struts-bean-el.tld"
prefix="bean-el" %>



.








.
[/CODE]

In my tiles-def.xml, I have:

[CODE]
   
  
  
  
   
[/CODE]

-Caroline


--- Jason Lea <[EMAIL PROTECTED]> wrote:
> Are you using the struts-el tags.  You might have
> them installed as 
> bean-el in which case you would need to use
> 
>  name="title"/> key="${titleKey}"/>
> 
> I only use the EL tags, so I just use bean as the
> tag prefix eg <%@ 
> taglib uri="/WEB-INF/jsp/tags/struts-bean-el.tld"
> prefix="bean" %>
> 
> 
> 
> Caroline Jen wrote:
> 
> >I tried both of your suggestions.  For example, I
> have
> >
> >[code]
> >.
> >
> > >name="title"/> >key="${titleKey}"/>
> >
> >
> >
> >
> >
> >.
> >[/code]
> >
> >I got java.lang.IllegalArgumentException: can't
> parse
> >argument number titleKey
> >
> >--- Jason Lea <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>If you are using JSTL you can do this:
> >>
> >> >>name="title"> >>key="${titleKey}"/>
> >>
> >>if that doesn't work, try this:
> >>
> >> >>name="title"/> >>key="${titleKey}"/>
> >>
> >>
> >>
> >>Caroline Jen wrote:
> >>
> >>
> >>
> >>>In general, the tile works fine for me except the
> >>>"title" piece.
> >>> 
> >>>[CODE]
> >>>.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>.
> >>>[/CODE]
> >>>
> >>>In my tiles-def.xml, I have:
> >>>
> >>>[CODE]
> >>>   >>>extends=".article.Base">
> >>>  >>>value="article.Menu.title"/>
> >>>  >>>value="/article/content/menu.jsp"/>
> >>>  >>>value="/article/common/navbarMenu.jsp"/>
> >>>  
> >>>[/CODE]
> >>>
> >>>The problem is that my application displays 
> >>>
> >>>article.Menu.title
> >>>
> >>>in the browser, instead of going to the
> >>>application.properties (which is in the
> >>>ApplicationRoot/WEB-INF/classes/resources folder)
> >>>  
> >>>
> >>to
> >>
> >>
> >>>get 
> >>>
> >>>article.Menu.title=Registered Members
> >>>
> >>>What should I do?
> >>>
> >>>__
> >>>Do you Yahoo!?
> >>>Yahoo! Finance Tax Center - File online. File on
> >>>  
> >>>
> >>time.
> >>
> >>
> >>>http://taxes.yahoo.com/filing.html
> >>>
> >>>  
> >>>
>
>>-
> >>
> >>
> >>>To unsubscribe, e-mail:
> >>>  
> >>>
> >>[EMAIL PROTECTED]
> >>
> >>
> >>>For additional commands, e-mail:
> >>>  
> >>>
> >>[EMAIL PROTECTED]
> >>
> >>
> >>> 
> >>>
> >>>  
> >>>
> >>-- 
> >>Jason Lea
> >>
> >>
> >>
> >>
> >>
> >>
>
>-
> >  
> >
> >>To unsubscribe, e-mail:
> >>[EMAIL PROTECTED]
> >>For additional commands, e-mail:
> >>[EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
> >__
> >Do you Yahoo!?
> >Yahoo! Finance Tax Center - File online. File on
> time.
> >http://taxes.yahoo.com/filing.html
> >
>
>-
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> 
> -- 
> Jason Lea
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Mark Lowe
You deal with the conversion else where but not in the form bean, you  
can argue about it or just believe me. The action form sits between the  
view and the action, the date conversion goes on between the action and  
the model.

Your approach isn't that bad its just not to the MVC pattern that  
struts follows (not that its the only one).

Create a date convertion util class or something.

If you dont want to take my word for it here's what craig had to say  
albeit in response to a different question


As the original designer of Struts :-), I must point out that the  
design of
ActionForm (and the recommendation that form bean properties be  
Strings) is
***very*** deliberate.  The reason this is needed is obvious when you  
consider
the following use case:

* You have an input form that, say, accepts only integers.

* Your form bean property is of type "int".

* The user types "1b3" instead of "123", by accident.

* Based on experience with any garden variety GUI application,
  the user will expect that they receive an error message,
  plus a redisplay of the form ***WITH THE INCORRECT VALUES
  THAT WERE ENTERED DISPLAYED SO THE USER CAN CORRECT THEM***.
* The current Struts environment will throw an exception
  due to the conversion failure.
* The suggested solution will ***hopelessly*** confuse the
  nature of a form bean, which is part of the VIEW tier, with
  model beans that have native data types.
Struts does not include any sort of "user interface component model"  
where the
details of conversion are hidden inside the user interface component.   
If that
is what you are after, you should look at a *real* user interface  
component
model (such as using JavaServer Faces with a Struts application).   
Corrupting
the functionality of a form bean to *pretend* that it is a user  
interface
component is only going to create complications for the world.


I hope this helps

Mark

On 25 Mar 2004, at 21:26, Sreenivasa Chadalavada wrote:

Application Tier is strongly typed.

So if the field is a java.util.Date in the database, then the data  
object will have the method

public DataObject{
        public java.util.Date getAsOfDate()
        public void setAsOfDate(java.util.Date asOfDate) methods.
}
My Action form is:

public MyActionForm extends ActionForm{
        public DataObject getDataObject();
        public void setDataObject(DataObject dataObject);
}
My jsp contains



This will fail if the user does not enter any date. I want the  
(changed) struts framework to handle that.

I did not want to create a new method with type String for every Date  
field

Hope this explanation helps !!

Thanks and Regards,
 Sree/-
  
--- 
-
 This is a PRIVATE message. If you are not the intended recipient,  
please delete without copying and kindly advise us by e-mail of the  
mistake in delivery. NOTE: Regardless of content, this e-mail shall  
not operate to bind CSC to any order or other contract unless pursuant  
to explicit written agreement or government initiative expressly  
permitting the use of e-mail for such purpose.
  
--- 
-





Mark Lowe 
03/25/2004 03:17 PM
Please respond to "Struts Users Mailing List"
       
        To:        "Struts Users Mailing List"  
<[EMAIL PROTECTED]>
        cc:        
        Subject:        Re: Handling Date objects in ActionForm  
gracefully



Ask yourself why are you trying to convert types for user input?

 On 25 Mar 2004, at 21:11, Sreenivasa Chadalavada wrote:

 > Do you know if the behavior can be overridden?
 >
 > Thanks and Regards,
 > Sree/-
 >
 >
 >  
---
 > -
 > This is a PRIVATE message. If you are not the intended recipient,  
 > please
 > delete without copying and kindly advise us by e-mail of the  
mistake in
 > delivery. NOTE: Regardless of content, this e-mail shall not  
operate to
 > bind CSC to any order or other contract unless pursuant to explicit
 > written agreement or government initiative expressly permitting the  
 
 > use of
 > e-mail for such purpose.
 >  
---
 > -
 >
 >
 >
 >
 >
 > "Takhar, Sandeep" 
 > @CIBC.ca>
 > 03/25/2004 02:53 PM
 > Please respond to "Struts Users Mailing List"
 >
 >
 >         To:     "Struts Users Mailing List"  
 > <[EMAIL PROTECTED]>
 >         cc:
 >         Subject:        RE: Handling Date objects in ActionForm  
 > gracefully
 >
 >
 > yes it is.  It should be done once per classloader.
 >
 > When struts populates the dyna form it is strin

RE: How to display a bean property with html markup?

2004-03-25 Thread S W
Hi Tim,
 
Yes, it solved the problem.
 
Thanks a lot,
 
Shirley

"Slattery, Tim - BLS" <[EMAIL PROTECTED]> wrote:
> Anybody knows how to display a bean property with html
> markup properly in the output. I have the JSP snippet
> code as follows:
> 
> 
> 
> abcdefg 



"filter=false" tells the tag not to replace things like "<" with "<".
That's what you want to hppen in this case.


--
Tim Slattery
[EMAIL PROTECTED]


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


-
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: Dynaform Type Conversion

2004-03-25 Thread Hubert Rabago
It does for the nightly build and Struts 1.2.0, though I can't recall the
name of the method.  For pre-1.2, you'll need to write code to do that. 
There was a thread that discussed this, with the last few messages (of that
thread) still coming in today.  Just look for that.  Richard Yee pasted code
there on how to instantiate a Dyna Bean.  I also pointed to an archive where
I pasted the code I use in my apps to instantiate a Dyna Bean. 

--- Joe Hertz <[EMAIL PROTECTED]> wrote:
> Well, I was using copyProperties...or rather I\'d want to. I\'m just trying
> 
> to 
> avoid having to declare my Transfer Objects the hard way.
> 
> Say I use Mark Lowe\'s idea of the Nested Form Bean (makes sense in alot of
> 
> ways), but I want to do it dynamically. i.e. DynaForm A has a List property
> 
> of what will be a bunch of DynaBean B\'s.
> 
> So riddle me this, how do I instantiate a DynaBean myself as it is defined
> in 
> the struts-config.xml?  When it\'s passed in to the Action as the form,
> it\'s 
> all prepped and ready to go. If I instantiate an instance of the class 
> myself, it\'s got no dynaproperties. I know BeanUtils will provide 
> functionality to do this, but I would hope there\'s an exposed method that 
> does based straight out of the contents struts-config.
> 
> Does Struts provide a method where I provide it the name of the bean
> defined 
> in the struts-config.xml and it return me an instance of the appropriate 
> class, with all the dyna properties set up?
> 
> -Joe
> 
> > -Original Message-
> > From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, March 25, 2004 8:38 AM
> > To: Struts Users Mailing List
> > Subject: Re: DynaForm Type Conversion
> > 
> > 
> > Take a look at BeanUtils.copyProperties.  By default, though, 
> > it doesn\'t support conversion of dates, since it wouldn\'t 
> > know how you\'d want your dates formatted.  Check the archives 
> > of this list, there\'s been some discussion on that.  Another 
> > archive you can check is that of the commons-user list.
> > 
> > If you\'re looking for further reduction in code, take a look 
> > at http://www.rabago.net/struts/formdef which I\'m working on. 
> >  It\'s alpha, but an initial release is coming real soon (and 
> > I\'m looking for folks to help me develop/maintain it).
> > 
> > I believe the Struts dev team has plans to include 
> > functionality like this in a future version of Struts.  For 
> > now, we either make do with BeanUtils, or do the conversion 
> > ourselves, or through third party plugins like what I\'m 
> > working on.  If you feel strongly enough about it, you can 
> > rant some more on 
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27321 
> > though like I said, the dev team has plans for supporting 
> > this functionality in a future version.  How near or far into 
> > the future might be influenced by user requests.  :)
> > 
> > 
> > --- Joe Hertz <[EMAIL PROTECTED]> wrote:
> > > 
> > > I have a bean I persist with Hibernate. It\'s properties are:
> > > 
> > > 2 Floats
> > > 1 Integer (the key)
> > > 2 Dates
> > > 
> > > Now, relying on my handy dandy copies of Struts KickStart, 
> > Struts In 
> > > Action, and all of the Web, I\'m apparently supposed to 
> > declare these 
> > > methods in the
> > > 
> > > Form I am using as Strings since automatic type conversion 
> > can fubar 
> > > them.
> > > 
> > > But Since the JSP I am using is getting these fields with html:text 
> > > fields, I apparently am supposed to have methods in form to do the 
> > > type conversion for
> > > me. Okay, that\'s light years better than putting this in 
> > the business
> > > layer, 
> > > but fine.
> > > 
> > > Is there an Automatic way I can get a DynaBean to do this for me? 
> > > Maybe a Get (prop, type) and get(prop, type, value) for the 
> > types youd 
> > > find in java.lang?
> > > 
> > > If not, there should be, because it limits what a DynaBean 
> > can do in a 
> > > big
> > > kinda way. Why have a type declaration in the DTD if youre 
> > only ever going
> > > to 
> > > want to use String and String[] ? :-)
> > > 
> > > I mean, it\'s not like I couldnt add such a set of methods to my
> > > DynaValidatorActionForm subclass, but what I\'d want 

Re: Dynaform Type Conversion

2004-03-25 Thread Joe Hertz
Well, I was using copyProperties...or rather I\'d want to. I\'m just trying 
to 
avoid having to declare my Transfer Objects the hard way.

Say I use Mark Lowe\'s idea of the Nested Form Bean (makes sense in alot of 
ways), but I want to do it dynamically. i.e. DynaForm A has a List property 
of what will be a bunch of DynaBean B\'s.

So riddle me this, how do I instantiate a DynaBean myself as it is defined in 
the struts-config.xml?  When it\'s passed in to the Action as the form, it\'s 
all prepped and ready to go. If I instantiate an instance of the class 
myself, it\'s got no dynaproperties. I know BeanUtils will provide 
functionality to do this, but I would hope there\'s an exposed method that 
does based straight out of the contents struts-config.

Does Struts provide a method where I provide it the name of the bean defined 
in the struts-config.xml and it return me an instance of the appropriate 
class, with all the dyna properties set up?

-Joe

> -Original Message-
> From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 25, 2004 8:38 AM
> To: Struts Users Mailing List
> Subject: Re: DynaForm Type Conversion
> 
> 
> Take a look at BeanUtils.copyProperties.  By default, though, 
> it doesn\'t support conversion of dates, since it wouldn\'t 
> know how you\'d want your dates formatted.  Check the archives 
> of this list, there\'s been some discussion on that.  Another 
> archive you can check is that of the commons-user list.
> 
> If you\'re looking for further reduction in code, take a look 
> at http://www.rabago.net/struts/formdef which I\'m working on. 
>  It\'s alpha, but an initial release is coming real soon (and 
> I\'m looking for folks to help me develop/maintain it).
> 
> I believe the Struts dev team has plans to include 
> functionality like this in a future version of Struts.  For 
> now, we either make do with BeanUtils, or do the conversion 
> ourselves, or through third party plugins like what I\'m 
> working on.  If you feel strongly enough about it, you can 
> rant some more on 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27321 
> though like I said, the dev team has plans for supporting 
> this functionality in a future version.  How near or far into 
> the future might be influenced by user requests.  :)
> 
> 
> --- Joe Hertz <[EMAIL PROTECTED]> wrote:
> > 
> > I have a bean I persist with Hibernate. It\'s properties are:
> > 
> > 2 Floats
> > 1 Integer (the key)
> > 2 Dates
> > 
> > Now, relying on my handy dandy copies of Struts KickStart, 
> Struts In 
> > Action, and all of the Web, I\'m apparently supposed to 
> declare these 
> > methods in the
> > 
> > Form I am using as Strings since automatic type conversion 
> can fubar 
> > them.
> > 
> > But Since the JSP I am using is getting these fields with html:text 
> > fields, I apparently am supposed to have methods in form to do the 
> > type conversion for
> > me. Okay, that\'s light years better than putting this in 
> the business
> > layer, 
> > but fine.
> > 
> > Is there an Automatic way I can get a DynaBean to do this for me? 
> > Maybe a Get (prop, type) and get(prop, type, value) for the 
> types youd 
> > find in java.lang?
> > 
> > If not, there should be, because it limits what a DynaBean 
> can do in a 
> > big
> > kinda way. Why have a type declaration in the DTD if youre 
> only ever going
> > to 
> > want to use String and String[] ? :-)
> > 
> > I mean, it\'s not like I couldnt add such a set of methods to my
> > DynaValidatorActionForm subclass, but what I\'d want is for 
> the framework to
> > 
> > use them for me without me needing to know about it. (I 
> dont ask for 
> > much, do I???).
> > 
> > If not, I\'d like to continue to use my Subclassed 
> > DynaValidatorActionForm
> > anyway, but I am wondering if it is going to be 
> self-defeating to declare 
> > custom getters and setters for properties that are declared 
> in struts
> > config? 
> > Should I just use it as a non-dyna form?
> > 
> > Maybe I\'ve been up too late (okay, I have) but it\'s the 
> little things 
> > like
> > this that makes me feel like Struts is creating work for me 
> rather than 
> > saving me from it. 
> > 
> > 
> > Tx for indulging my sleepy rant.
> > -Joe
> > 
> > 
> 
> __
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time. 
http://taxes.yahoo.com/filing.html

-
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: form based auth and session timeout and post data

2004-03-25 Thread Adam Hardy
Martin,
I'm not familiar with xpetstore, so I didn't say anything when I read 
that you had container-managed security and a sign-on filter redirecting 
unauthenticated users. Basically you have made the sign-on filter 
redundant by implementing container-managed security.

However that's not to say that the sign-on filter doesn't do other stuff 
as well - I don't know. One thing for instance could be that it puts 
user information into the session so you don't need to repeatedly fetch 
the info with each request.

The filter won't be by-passed - it's not affected by the app you're 
running, only by tomcat 'filtering' on the URL and passing it the 
requests it's been configured to see in the web.xml.

Adam

On 03/25/2004 10:35 PM Martin Alley wrote:
Hi Adam,

I modified the filter from xpetstore when I introduced container based
security.  It should now redirect the user to the signonAction to
synchronise container based auth with session based (legacy) record of
the logged in user.  Thinking about it there could be some problems in
there, but in the session timeout scenario, the SignonFilter doesn't get
hit straight away (unlike the non-timeout scenario).
I guess the order of play is:
Container based security
Filter
ActionServlet
Can't work out why the filter would appear to be bypassed.

Any ideas?

Thanks for helping.
Martin
-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: 25 March 2004 21:18
To: Struts Users Mailing List
Subject: Re: form based auth and session timeout and post data

That's one mean filter.

It's not part of struts but judging merely from its name, it's obviously

built into the app security. What does xpetstore say it's meant to do? 
Have you checked the filter's javadoc?

Adam

On 03/25/2004 10:07 PM Martin Alley wrote:

Hi,



I've got a struts based app using form based authentication (started
out

as xpetstore).

I have a situation where if I'm on a web form protected by role based
security, and the session times out, and then I submit the form, I get
to the login page, login, but then the original form data is lost.


According to the log data, it's looking for an ActionForm of a
different

name according to whether the session has timed out or not!!!

I thought this stuff was statically configured.



When there is no time out, the log looks like this:

2004-03-25 19:40:19,350 INFO  [xpetstore.web.filter.SignOnFilter]
doFilter()
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
user=bug1b
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
isSignedIn=true
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
uri=/MotoringMemorabilia/updateCustomer.jspa
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
_login=/login.jspa
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Get

module name for path /updateCustomer.jspa

2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 19:40:19,350 DEBUG
[org.apache.struts.action.RequestProcessor] Processing a 'POST' for
path

'/updateCustomer'

2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Looking for ActionForm bean instance in scope 'request' under
attribute

key 'existingCustomerForm'

2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Creating new ActionForm instance of type
'xpetstore.web.struts.action.customer.ExistingCustomerForm'
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
-->

[EMAIL PROTECTED]

2004-03-25 19:40:19,350 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing ActionForm bean
instance in scope 'request' under attribute key 'existingCustomerForm'
2004-03-25 19:40:19,350 DEBUG
[org.apache.struts.action.RequestProcessor]  Populating bean
properties

from this request

2004-03-25 19:40:19,360 DEBUG
[org.apache.struts.action.RequestProcessor]  Validating input form
properties
2004-03-25 19:40:19,370 DEBUG
[org.apache.struts.action.RequestProcessor]   No errors detected,
accepting input
2004-03-25 19:40:19,370 DEBUG
[org.apache.struts.action.RequestProcessor]  Looking for Action
instance

for class xpetstore.web.struts.action.customer.UpdateCustomerAction

2004-03-25 19:40:19,370 DEBUG
[org.apache.struts.action.RequestProcessor]   Creating new Action
instance
2004-03-25 19:40:19,370 INFO
[xpetstore.web.struts.action.customer.UpdateCustomerAction] execute()






When there is a timeout the log goes like this:

2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
Looking for ActionForm bean instance in scope 'request' under
attribute

key 'newCustomerForm'

2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
Creating new ActionForm instance of type
'xpetstore.web.struts.actio

RE: Using JSTL Instead of Nested Tags

2004-03-25 Thread Robert Taylor
Mike, you will have to expose the form like:



...where "myForm" is its name defined in the struts-config file.

If its DynaForm then you have to expose the form map:



Once you do this, you can use JSTL to access and render values:



or 




robert

> -Original Message-
> From: Mike Duffy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 4:46 PM
> To: Struts Users Mailing List
> Subject: Using JSTL Instead of Nested Tags
> 
> 
> I'm trying to convert an application from Struts display tags to JSTL (still using 
> Struts as the
> MVC).
> 
> I am having some difficulty converting nested tags to JSTL.
> 
> Can anyone offer any guidance?
> 
> Thanks.
> 
> Mike
> 
> __
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html
> 
> -
> 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: form based auth and session timeout and post data

2004-03-25 Thread Martin Alley
Hi Adam,

I modified the filter from xpetstore when I introduced container based
security.  It should now redirect the user to the signonAction to
synchronise container based auth with session based (legacy) record of
the logged in user.  Thinking about it there could be some problems in
there, but in the session timeout scenario, the SignonFilter doesn't get
hit straight away (unlike the non-timeout scenario).

I guess the order of play is:
Container based security
Filter
ActionServlet

Can't work out why the filter would appear to be bypassed.

Any ideas?

Thanks for helping.
Martin


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: 25 March 2004 21:18
To: Struts Users Mailing List
Subject: Re: form based auth and session timeout and post data

That's one mean filter.

It's not part of struts but judging merely from its name, it's obviously

built into the app security. What does xpetstore say it's meant to do? 
Have you checked the filter's javadoc?

Adam

On 03/25/2004 10:07 PM Martin Alley wrote:
> Hi,
> 
>  
> 
> I've got a struts based app using form based authentication (started
out
> as xpetstore).
> 
> I have a situation where if I'm on a web form protected by role based
> security, and the session times out, and then I submit the form, I get
> to the login page, login, but then the original form data is lost.
> 
>  
> 
> According to the log data, it's looking for an ActionForm of a
different
> name according to whether the session has timed out or not!!!
> 
> I thought this stuff was statically configured.
> 
>  
> 
> When there is no time out, the log looks like this:
> 
> 2004-03-25 19:40:19,350 INFO  [xpetstore.web.filter.SignOnFilter]
> doFilter()
> 
> 2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
> user=bug1b
> 
> 2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
> isSignedIn=true
> 
> 2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
> uri=/MotoringMemorabilia/updateCustomer.jspa
> 
> 2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
> _login=/login.jspa
> 
> 2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Get
> module name for path /updateCustomer.jspa
> 
> 2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
> Module name found: default
> 
> 2004-03-25 19:40:19,350 DEBUG
> [org.apache.struts.action.RequestProcessor] Processing a 'POST' for
path
> '/updateCustomer'
> 
> 2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
> Looking for ActionForm bean instance in scope 'request' under
attribute
> key 'existingCustomerForm'
> 
> 2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
> Creating new ActionForm instance of type
> 'xpetstore.web.struts.action.customer.ExistingCustomerForm'
> 
> 2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
-->
> [EMAIL PROTECTED]
> 
> 2004-03-25 19:40:19,350 DEBUG
> [org.apache.struts.action.RequestProcessor]  Storing ActionForm bean
> instance in scope 'request' under attribute key 'existingCustomerForm'
> 
> 2004-03-25 19:40:19,350 DEBUG
> [org.apache.struts.action.RequestProcessor]  Populating bean
properties
> from this request
> 
> 2004-03-25 19:40:19,360 DEBUG
> [org.apache.struts.action.RequestProcessor]  Validating input form
> properties
> 
> 2004-03-25 19:40:19,370 DEBUG
> [org.apache.struts.action.RequestProcessor]   No errors detected,
> accepting input
> 
> 2004-03-25 19:40:19,370 DEBUG
> [org.apache.struts.action.RequestProcessor]  Looking for Action
instance
> for class xpetstore.web.struts.action.customer.UpdateCustomerAction
> 
> 2004-03-25 19:40:19,370 DEBUG
> [org.apache.struts.action.RequestProcessor]   Creating new Action
> instance
> 
> 2004-03-25 19:40:19,370 INFO
> [xpetstore.web.struts.action.customer.UpdateCustomerAction] execute()
> 
>  
> 
>  
> 
>  
> 
> When there is a timeout the log goes like this:
> 
> 2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
> Looking for ActionForm bean instance in scope 'request' under
attribute
> key 'newCustomerForm'
> 
> 2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
> Creating new ActionForm instance of type
> 'xpetstore.web.struts.action.customer.NewCustomerForm'
> 
> 2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
-->
> [EMAIL PROTECTED]
> 
> 2004-03-25 20:10:56,918 DEBUG [org.apache.struts.util.RequestUtils]
Get
> module name for path /index.jsp
> 
> 2004-03-25 20:10:56,928 DEBUG

Re: dynamic widgets

2004-03-25 Thread Adam Hardy
Give us an example. What is the form editing?

The iterate tag is probably what you want, if it's simple.

Or you could use NestedBeans. If the form edits the actual object, you 
can get a bunch of beans, each representing x pieces of info, and store 
them inside the main object.

Just throwing out ideas.

Adam

On 03/25/2004 04:37 PM Dean A. Hoover wrote:
Scenario: An HTML form is contructed using
JSP where most of the widgets are statically created
(except for labels). However, there is a group of
check boxes which are created based on information
contained in a database. There may be one checkbox
or many. How would you express this in the form-bean
in struts-config.xml. I am using DynaValidatorForm
but will actually be doing validation for this group
of checkboxes in the Action.
Any ideas?
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: form based auth and session timeout and post data

2004-03-25 Thread Adam Hardy
That's one mean filter.

It's not part of struts but judging merely from its name, it's obviously 
built into the app security. What does xpetstore say it's meant to do? 
Have you checked the filter's javadoc?

Adam

On 03/25/2004 10:07 PM Martin Alley wrote:
Hi,

 

I've got a struts based app using form based authentication (started out
as xpetstore).
I have a situation where if I'm on a web form protected by role based
security, and the session times out, and then I submit the form, I get
to the login page, login, but then the original form data is lost.
 

According to the log data, it's looking for an ActionForm of a different
name according to whether the session has timed out or not!!!
I thought this stuff was statically configured.

 

When there is no time out, the log looks like this:

2004-03-25 19:40:19,350 INFO  [xpetstore.web.filter.SignOnFilter]
doFilter()
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
user=bug1b
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
isSignedIn=true
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
uri=/MotoringMemorabilia/updateCustomer.jspa
2004-03-25 19:40:19,350 DEBUG [xpetstore.web.filter.SignOnFilter]
_login=/login.jspa
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /updateCustomer.jspa
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 19:40:19,350 DEBUG
[org.apache.struts.action.RequestProcessor] Processing a 'POST' for path
'/updateCustomer'
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Looking for ActionForm bean instance in scope 'request' under attribute
key 'existingCustomerForm'
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]
Creating new ActionForm instance of type
'xpetstore.web.struts.action.customer.ExistingCustomerForm'
2004-03-25 19:40:19,350 DEBUG [org.apache.struts.util.RequestUtils]  -->
[EMAIL PROTECTED]
2004-03-25 19:40:19,350 DEBUG
[org.apache.struts.action.RequestProcessor]  Storing ActionForm bean
instance in scope 'request' under attribute key 'existingCustomerForm'
2004-03-25 19:40:19,350 DEBUG
[org.apache.struts.action.RequestProcessor]  Populating bean properties
from this request
2004-03-25 19:40:19,360 DEBUG
[org.apache.struts.action.RequestProcessor]  Validating input form
properties
2004-03-25 19:40:19,370 DEBUG
[org.apache.struts.action.RequestProcessor]   No errors detected,
accepting input
2004-03-25 19:40:19,370 DEBUG
[org.apache.struts.action.RequestProcessor]  Looking for Action instance
for class xpetstore.web.struts.action.customer.UpdateCustomerAction
2004-03-25 19:40:19,370 DEBUG
[org.apache.struts.action.RequestProcessor]   Creating new Action
instance
2004-03-25 19:40:19,370 INFO
[xpetstore.web.struts.action.customer.UpdateCustomerAction] execute()
 

 

 

When there is a timeout the log goes like this:

2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
Looking for ActionForm bean instance in scope 'request' under attribute
key 'newCustomerForm'
2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]
Creating new ActionForm instance of type
'xpetstore.web.struts.action.customer.NewCustomerForm'
2004-03-25 20:10:56,908 DEBUG [org.apache.struts.util.RequestUtils]  -->
[EMAIL PROTECTED]
2004-03-25 20:10:56,918 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /index.jsp
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /cart.jspa
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /signon.jspa
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /search.jspa
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Looking for ActionForm bean instance in scope 'request' under attribute
key 'searchForm'
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Creating new ActionForm instance of type
'xpetstore.web.struts.action.product.SearchForm'
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]  -->
[EMAIL PROTECTED]
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /index.jsp
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils]
Module name found: default
2004-03-25 20:10:56,928 DEBUG [org.apache.struts.util.RequestUtils] Get
module name for path /category.jspa?categoryId=SIGNS
 

The relevant action configuration looks like this:



  path="/updateCustomer"

  type="xpetstore.

RE: How to display a bean property with html markup?

2004-03-25 Thread Slattery, Tim - BLS
> Anybody knows how to display a bean property with html
> markup properly in the output. I have the JSP snippet
> code as follows:
>  
> 
> 
> abcdefg 



"filter=false" tells the tag not to replace things like "<" with "<".
That's what you want to hppen in this case.


--
Tim Slattery
[EMAIL PROTECTED]


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



RE: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Takhar, Sandeep
There are converters that can be used for overriding.  For example BigDecimalConverter 
is a converter that handles any object going to a BigDecimal.

you need to register the converters.  Take a look at BeanUtils.deregister which is 
called in a static block at the beginning of BeanUtils.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 3:11 PM
To: Struts Users Mailing List
Subject: RE: Handling Date objects in ActionForm gracefully


Do you know if the behavior can be overridden?

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






"Takhar, Sandeep" 
03/25/2004 02:53 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
    cc: 
Subject:RE: Handling Date objects in ActionForm gracefully


yes it is.  It should be done once per classloader.

When struts populates the dyna form it is string array to string array 
conversion and uses 
populate method of BeanUtils which eventually calls the converters.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:47 PM
To: Struts Users Mailing List
Subject: Re: Handling Date objects in ActionForm gracefully


I am thinking of overriding the struts default mechanism.
Override the default behavior of org.apache.commons.beanutils.ConvertUtils 

by registering
a valid converter...

I want to know if the above is possible..

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 

e-mail for such purpose.






Mark Lowe 
03/25/2004 02:36 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
cc: 
Subject:Re: Handling Date objects in ActionForm gracefully


Have it as a string and convert it to a date or calendar when you pass 
it back to the model.


On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

> All,
>
> We are facing a problem when we define java.util.Date field in 
> ActionForm.
>
> Is there any way to override the default behavior provided by Struts?
>
> I very much appreciate your help!!
>
> Thanks and Regards,
> Sree/-
>
>
> --- 
> -
> This is a PRIVATE message. If you are not the intended recipient, 
> please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the 
> use of
> e-mail for such purpose.
> --- 
> -


-
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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread anant.parnami


Define your own Form bean class which extends the DynaForm  and then you
can override the get/set methods
In those methods you need to check if the type is Date then perform
whatever operation you want

Regards

Anant

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 1:06 AM
To: Struts Users Mailing List
Subject: RE: Handling Date objects in ActionForm gracefully


What's the problem?

robert

> -Original Message-
> From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 2:28 PM
> To: Struts Users Mailing List
> Subject: Handling Date objects in ActionForm gracefully
>
>
> All,
>
> We are facing a problem when we define java.util.Date field in
> ActionForm.
>
> Is there any way to override the default behavior provided by Struts?
>
> I very much appreciate your help!!
>
> Thanks and Regards,
> Sree/-
>
>
> --
> --
> This is a PRIVATE message. If you are not the intended recipient,
please
> delete without copying and kindly advise us by e-mail of the mistake
in
> delivery. NOTE: Regardless of content, this e-mail shall not operate
to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the
use of
> e-mail for such purpose.
>


>

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


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Struts tag problem (bean:message and bean:write)

2004-03-25 Thread Daniel H A Lima
Marco, can you use bean:define and a scriptlet code
inside bean:message ? Something like :





 --- Marco Mistroni <[EMAIL PROTECTED]>
escreveu: > Hi all,
>   I was wondering if anyone of you have a solution
> For this dilemma.
> I have a collectin of product DTOs to show on my
> jsp. One of 
> DTO's property is, let's say, the type, which is
> listed in number.
> (let's say, 10 or 20).
> ON the DTO I will have the value 10,20 ecc but on
> the jsp I have to
> display
> The corresponding string (let's say, HouseProduct or
> Car or something
> else) which is listed in application.resources.
> 
> I am looping thru the collection using
> logic:iterate, and
> as I have found out myself, following code does not
> work
> 
> 
> 
> 
> basically in app.resources I will have
> prompt.productType.10=HouseProduct
> prompt.productType.20=Car
> 
> etc..
> 
> above, I am outputting the message  
> prompt.productType.(productType)
> 
> how can I solve my dilemma, keeping in mind that I
> am using also
> logic:iterate to loop thru the collection?
> 
> With best regards
>   marco
> 


__

Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
http://br.yahoo.com/info/mail.html

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



Re: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Mark Lowe
Ask yourself why are you trying to convert types for user input?

On 25 Mar 2004, at 21:11, Sreenivasa Chadalavada wrote:

Do you know if the behavior can be overridden?

Thanks and Regards,
Sree/-
--- 
-
This is a PRIVATE message. If you are not the intended recipient,  
please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the  
use of
e-mail for such purpose.
--- 
-





"Takhar, Sandeep" 
03/25/2004 02:53 PM
Please respond to "Struts Users Mailing List"
To: "Struts Users Mailing List"  
<[EMAIL PROTECTED]>
    cc:
Subject:RE: Handling Date objects in ActionForm  
gracefully

yes it is.  It should be done once per classloader.

When struts populates the dyna form it is string array to string array
conversion and uses
populate method of BeanUtils which eventually calls the converters.
sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:47 PM
To: Struts Users Mailing List
Subject: Re: Handling Date objects in ActionForm gracefully
I am thinking of overriding the struts default mechanism.
Override the default behavior of  
org.apache.commons.beanutils.ConvertUtils

by registering
a valid converter...
I want to know if the above is possible..

Thanks and Regards,
Sree/-
--- 
-
This is a PRIVATE message. If you are not the intended recipient,  
please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the  
use of

e-mail for such purpose.
--- 
-





Mark Lowe 
03/25/2004 02:36 PM
Please respond to "Struts Users Mailing List"
To: "Struts Users Mailing List"
<[EMAIL PROTECTED]>
cc:
Subject:Re: Handling Date objects in ActionForm  
gracefully

Have it as a string and convert it to a date or calendar when you pass
it back to the model.
On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

All,

We are facing a problem when we define java.util.Date field in
ActionForm.
Is there any way to override the default behavior provided by Struts?

I very much appreciate your help!!

Thanks and Regards,
Sree/-
-- 
-
-
This is a PRIVATE message. If you are not the intended recipient,
please
delete without copying and kindly advise us by e-mail of the mistake  
in
delivery. NOTE: Regardless of content, this e-mail shall not operate  
to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the
use of
e-mail for such purpose.
-- 
-
-


-
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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Sreenivasa Chadalavada
Do you know if the behavior can be overridden?

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






"Takhar, Sandeep" 
03/25/2004 02:53 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
    cc: 
Subject:RE: Handling Date objects in ActionForm gracefully


yes it is.  It should be done once per classloader.

When struts populates the dyna form it is string array to string array 
conversion and uses 
populate method of BeanUtils which eventually calls the converters.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:47 PM
To: Struts Users Mailing List
Subject: Re: Handling Date objects in ActionForm gracefully


I am thinking of overriding the struts default mechanism.
Override the default behavior of org.apache.commons.beanutils.ConvertUtils 

by registering
a valid converter...

I want to know if the above is possible..

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 

e-mail for such purpose.






Mark Lowe 
03/25/2004 02:36 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
cc: 
Subject:Re: Handling Date objects in ActionForm gracefully


Have it as a string and convert it to a date or calendar when you pass 
it back to the model.


On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

> All,
>
> We are facing a problem when we define java.util.Date field in 
> ActionForm.
>
> Is there any way to override the default behavior provided by Struts?
>
> I very much appreciate your help!!
>
> Thanks and Regards,
> Sree/-
>
>
> --- 
> -
> This is a PRIVATE message. If you are not the intended recipient, 
> please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the 
> use of
> e-mail for such purpose.
> --- 
> -


-
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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Takhar, Sandeep
yes it is.  It should be done once per classloader.

When struts populates the dyna form it is string array to string array conversion and 
uses 
populate method of BeanUtils which eventually calls the converters.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:47 PM
To: Struts Users Mailing List
Subject: Re: Handling Date objects in ActionForm gracefully


I am thinking of overriding the struts default mechanism.
Override the default behavior of org.apache.commons.beanutils.ConvertUtils 
by registering
a valid converter...

I want to know if the above is possible..

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






Mark Lowe 
03/25/2004 02:36 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc: 
Subject:Re: Handling Date objects in ActionForm gracefully


Have it as a string and convert it to a date or calendar when you pass 
it back to the model.


On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

> All,
>
> We are facing a problem when we define java.util.Date field in 
> ActionForm.
>
> Is there any way to override the default behavior provided by Struts?
>
> I very much appreciate your help!!
>
> Thanks and Regards,
> Sree/-
>
>
> --- 
> -
> This is a PRIVATE message. If you are not the intended recipient, 
> please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the 
> use of
> e-mail for such purpose.
> --- 
> -


-
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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Robert Taylor
+1

> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 2:36 PM
> To: Struts Users Mailing List
> Subject: Re: Handling Date objects in ActionForm gracefully
> 
> 
> Have it as a string and convert it to a date or calendar when you pass  
> it back to the model.
> 
> 
> On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:
> 
> > All,
> >
> > We are facing a problem when we define java.util.Date field in  
> > ActionForm.
> >
> > Is there any way to override the default behavior provided by Struts?
> >
> > I very much appreciate your help!!
> >
> > Thanks and Regards,
> > Sree/-
> >
> >
> > --- 
> > -
> > This is a PRIVATE message. If you are not the intended recipient,  
> > please
> > delete without copying and kindly advise us by e-mail of the mistake in
> > delivery. NOTE: Regardless of content, this e-mail shall not operate to
> > bind CSC to any order or other contract unless pursuant to explicit
> > written agreement or government initiative expressly permitting the  
> > use of
> > e-mail for such purpose.
> > --- 
> > -
> 
> 
> -
> 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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Sreenivasa Chadalavada
I am thinking of overriding the struts default mechanism.
Override the default behavior of org.apache.commons.beanutils.ConvertUtils 
by registering
a valid converter...

I want to know if the above is possible..

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






Mark Lowe 
03/25/2004 02:36 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc: 
Subject:Re: Handling Date objects in ActionForm gracefully


Have it as a string and convert it to a date or calendar when you pass 
it back to the model.


On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

> All,
>
> We are facing a problem when we define java.util.Date field in 
> ActionForm.
>
> Is there any way to override the default behavior provided by Struts?
>
> I very much appreciate your help!!
>
> Thanks and Regards,
> Sree/-
>
>
> --- 
> -
> This is a PRIVATE message. If you are not the intended recipient, 
> please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the 
> use of
> e-mail for such purpose.
> --- 
> -


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





RE: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Sreenivasa Chadalavada
The date fields in jsp are not mandatory. So there will be null strings in 
the request/session. 

As I understand, Struts tries to create Date object out of the null string 
and chokes on it.

I would like to know if my understanding is correct ?

If this is true are there any solutions for the problem?

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






"Robert Taylor" 
03/25/2004 02:35 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
    cc: 
Subject:RE: Handling Date objects in ActionForm gracefully


What's the problem? 

robert

> -Original Message-
> From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 2:28 PM
> To: Struts Users Mailing List
> Subject: Handling Date objects in ActionForm gracefully
> 
> 
> All,
> 
> We are facing a problem when we define java.util.Date field in 
ActionForm.
> 
> Is there any way to override the default behavior provided by Struts?
> 
> I very much appreciate your help!!
> 
> Thanks and Regards,
> Sree/-
> 
> 
> 

> This is a PRIVATE message. If you are not the intended recipient, please 

> delete without copying and kindly advise us by e-mail of the mistake in 
> delivery. NOTE: Regardless of content, this e-mail shall not operate to 
> bind CSC to any order or other contract unless pursuant to explicit 
> written agreement or government initiative expressly permitting the use 
of 
> e-mail for such purpose.
> 

> 

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





Re: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Mark Lowe
Have it as a string and convert it to a date or calendar when you pass  
it back to the model.

On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

All,

We are facing a problem when we define java.util.Date field in  
ActionForm.

Is there any way to override the default behavior provided by Struts?

I very much appreciate your help!!

Thanks and Regards,
Sree/-
--- 
-
This is a PRIVATE message. If you are not the intended recipient,  
please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the  
use of
e-mail for such purpose.
--- 
-


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


RE: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Robert Taylor
What's the problem? 

robert

> -Original Message-
> From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 2:28 PM
> To: Struts Users Mailing List
> Subject: Handling Date objects in ActionForm gracefully
> 
> 
> All,
> 
> We are facing a problem when we define java.util.Date field in ActionForm.
> 
> Is there any way to override the default behavior provided by Struts?
> 
> I very much appreciate your help!!
> 
> Thanks and Regards,
> Sree/-
> 
> 
> 
> This is a PRIVATE message. If you are not the intended recipient, please 
> delete without copying and kindly advise us by e-mail of the mistake in 
> delivery. NOTE: Regardless of content, this e-mail shall not operate to 
> bind CSC to any order or other contract unless pursuant to explicit 
> written agreement or government initiative expressly permitting the use of 
> e-mail for such purpose.
> 
> 

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



Re: Exception handling in struts

2004-03-25 Thread Tate Austin
ooops, thank you regarding the java.lang.Exception.  As for ExceptionCatcher
all that is correct.  I did make that change in an earlier iteration.  That
lowercase wasn't the issue sadly.  Now, when I installed Easy Struts just
now it told me "path not found in webapp" which is not true from my
perspective.  "/jsp/error.jsp" exists and all the other calls from struts
config use the "/jsp/*.jsp" format and work properly.  Has anyone out there
had an experience like this with exception handling?
- Original Message - 
From: "Nick Wesselman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 25, 2004 10:04 AM
Subject: Re: Exception handling in struts


> Didn't someone already answer this for you? Maybe we need to be more
> explicit. Try this:
>
> 
>
> 
> key="uncaught_exception"
>
> type="java.lang.Exception"
>
> path="/jsp/error.jsp"
>
> handler="com.graysail.pgbadmecs.exceptions.ExceptionCatcher"
>
> scope="request"/>
>
> 
>
>
> "Exception" needs to be upper case. If your ExceptionCatcher really is
> called exceptioncatcher (all lower case), then keep your handler line
> the same.
>
> Nick
>
>
> Tate Austin wrote:
>
> >I'm trying to write an exception handler in my struts-config to clean up
my application's exception behavior.  Well, I've followed the directions in
the docs to a T, I have this entry in my struts config:
> >
> >
> >
> > >
> >key="uncaught_exception"
> >
> >type="java.lang.exception"
> >
> >path="/jsp/error.jsp"
> >
> >handler="com.graysail.pgbadmecs.exceptions.exceptioncatcher"
> >
> >scope="request"/>
> >
> >
> >
> >
> >
> >my exception catcher extends GlobalExceptionHandler and bears an
execute() method.  Well, when an error of type exception goes off, the
catcher is never called to it?  What ingredient am I missing?
> >
> >
> >
>
>
>
> -
> 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: pre-populating DynaValidatorForm

2004-03-25 Thread Yee, Richard K,,DMDCWEST
Takhar,
Yes. If you are using modules, then you'd have to add:

 fbc.setModuleConfig(mapping.getModuleConfig());

-Richard

-Original Message-
From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 25, 2004 4:47 AM
To: Struts Users Mailing List
Subject: RE: pre-populating DynaValidatorForm


Isn't this assuming there are no modules?

sandeep

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 7:11 PM
To: 'Struts Users Mailing List'
Subject: RE: pre-populating DynaValidatorForm


Dean,
Here's the essential code in order to instantiate a DynaActionForm from
within an Action class.

 FormBeanConfig fbc = new FormBeanConfig();  fbc.setName("myForm");
DynaActionFormClass dafc =
DynaActionFormClass.createDynaActionFormClass(fbc);
 DynaActionForm formBean = (DynaActionForm) dafc.newInstance();
formBean.set("myProperty", "someValue");
request.setAttribute("myDynaForm",formBean);

-Richard
-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 23, 2004 7:48 AM
To: Struts Users Mailing List
Subject: Re: pre-populating DynaValidatorForm


See http://www.mail-archive.com/[EMAIL PROTECTED]/msg96035.html

hth,
Hubert

--- "Dean A. Hoover" <[EMAIL PROTECTED]> wrote:
> I am using struts 1.1, and I am directly instantiating a 
> DynaValidatorForm in my Action class. I am hesitant to embrace struts 
> 1.2 at this time, especially if
> the difference between 1.1 and 1.2 is as large as betwee 1.0 and 1.1. Is 
> there
> some other way to accomplish it?
> 
> Dean Hoover
> 
> Hubert Rabago wrote:
> 
> >What version of Struts are you using?  How are you instantiating your
> >Dyna*Form?  Struts 1.1 didn't really have direct support for 
> >instantiating DyanForms from an Action object.  Struts 1.2.0/nightly 
> >build does.  Is it possible that you're using 1.1 and instantiating the
form incorrectly?
> >
> >  
> >


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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

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



Re: html inside an action

2004-03-25 Thread Mark Lowe
I'd go n have a cup of tea..

On 25 Mar 2004, at 17:54, ruben wrote:

hi
Those are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on 
my action , is it possible? thanks a lot ,
Regards.

Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally 
you shouldn't be doing any client-side stuff in your Actions.
A cleaner approach would be to use Custom Tags to have the HTML 
generation code and you can call them from your JSPs. (Remember that 
JSPs are not sent to the browser, it is the code they generate that is 
sent to the client browser).
Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action
Qureshi, Affan wrote:


What part of JSP do you want to generate? Is it Java code in the JSP 
that you want to generate or static HTML/JavaScript? You might want 
to look at Tag Libraries as well.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:00 AM
To: Struts Users Mailing List
Subject: html inside an action
hi!
how can i get the output generate in a .jsp inside an action like it 
was a resource that i can process(a String or something else)???
thanks a lot in advance.

PD: I need to call jasper compiler or something similar? what can i 
do that? thanks

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



hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot

-
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: Tile Problem

2004-03-25 Thread Tin Pham
Hi,

You need to do the following in the jsp page,



Then where you want the internationalized text to appear you use,


Oh yeah you will need to add your taglib references as follows,
<%@ taglib uri="/whateverYourPathIs" prefix="tiles" %>
<%@ taglib uri="/whateverYourPathIs" prefix="bean" %>


Hope that helped,

Tin


"Caroline Jen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In general, the tile works fine for me except the
> "title" piece.
>
> [CODE]
> .
> 
> 
> 
> 
> 
> 
> 
> .
> [/CODE]
>
> In my tiles-def.xml, I have:
>
> [CODE]
> extends=".article.Base">
>value="article.Menu.title"/>
>value="/article/content/menu.jsp"/>
>value="/article/common/navbarMenu.jsp"/>
>
> [/CODE]
>
> The problem is that my application displays
>
> article.Menu.title
>
> in the browser, instead of going to the
> application.properties (which is in the
> ApplicationRoot/WEB-INF/classes/resources folder) to
> get
>
> article.Menu.title=Registered Members
>
> What should I do?
>
> __
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html




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



Re: Res: html inside an action

2004-03-25 Thread Richard Yee
Ruben,
Why is it your requirement to get a page as HTML
inside an Action? It seems like you've made an
implementation decision. Like several people have
suggested, it is much easier to do this (and probably
better too), by using a custom tag library inside the
JSP itself. Several tag libraries are already
available that email the page content or return it as
a String.

Regards,

Richard

--- ruben <[EMAIL PROTECTED]> wrote:
> hi
> Those are my requirements, i have to convert objects
> to html, in my 
> action and get this html in a String, i thought that
> the jsp is a good 
> way to do this,
> I want the code that   jsp generate (that is sent to
> the browser) on my 
> action , is it possible? thanks a lot ,
> Regards.
> 
> >
> >
> > Qureshi, Affan wrote:
> >
> > So why cant you use simple JSTL or struts-EL tags
> to do it? Ideally 
> > you shouldn't be doing any client-side stuff in
> your Actions.
> > A cleaner approach would be to use Custom Tags to
> have the HTML 
> > generation code and you can call them from your
> JSPs. (Remember that 
> > JSPs are not sent to the browser, it is the code
> they generate that is 
> > sent to the client browser).
> > Or maybe I dont understand your requirements.
> >
> > Regards.
> >
> > -Original Message-
> > From: ruben [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 25, 2004 10:19 AM
> > To: Struts Users Mailing List
> > Subject: Re: html inside an action
> >
> >
> > Qureshi, Affan wrote:
> >
> >
> >
> >> What part of JSP do you want to generate? Is it
> Java code in the JSP 
> >> that you want to generate or static
> HTML/JavaScript? You might want 
> >> to look at Tag Libraries as well.
> >>
> >>
> >> -Original Message-
> >> From: ruben [mailto:[EMAIL PROTECTED]
> >> Sent: Thursday, March 25, 2004 10:00 AM
> >> To: Struts Users Mailing List
> >> Subject: html inside an action
> >>
> >>
> >> hi!
> >> how can i get the output generate in a .jsp
> inside an action like it 
> >> was a resource that i can process(a String or
> something else)???
> >> thanks a lot in advance.
> >>
> >> PD: I need to call jasper compiler or something
> similar? what can i 
> >> do that? thanks
> >>
> >>
> >>
>
-
> >> 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]
> >>
> >>
> >>
> >>   
> >
> >
> > hi, thanks for the response, i want the code
> generated 
> > (HTML/javascript), it's like redirect the output
> to a resource that i 
> > can process in the action instead of send to the
> navigator,
> > thanks a lot
> >
> >
> >
>
-
> > 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]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



RE: html inside an action

2004-03-25 Thread Brendan Richards
There's also jakarkta commons-httpclient

http://jakarta.apache.org/commons/httpclient/

-Original Message-
From: Qureshi, Affan [mailto:[EMAIL PROTECTED] 
Sent: 25 March 2004 17:04
To: Struts Users Mailing List
Subject: RE: html inside an action

HttpUnit is also a neat tool which might help. Have a JSP generate the
HTML and access that using HttpUnit (or a simple URLConnection/Socket
for that matter). And you can get the generated HTML in your Action. 

I hope I understand you this time.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:54 AM
To: Struts Users Mailing List
Subject: Re: html inside an action


hi
Those are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on my 
action , is it possible? thanks a lot ,
Regards.


Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally you 
shouldn't be doing any client-side stuff in your Actions.
A cleaner approach would be to use Custom Tags to have the HTML 
generation code and you can call them from your JSPs. (Remember that 
JSPs are not sent to the browser, it is the code they generate that is 
sent to the client browser).
Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action


Qureshi, Affan wrote:

 

> What part of JSP do you want to generate? Is it Java code in the JSP 
> that you want to generate or static HTML/JavaScript? You might want to

> look at Tag Libraries as well.
>
>
> -Original Message-
> From: ruben [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 10:00 AM
> To: Struts Users Mailing List
> Subject: html inside an action
>
>
> hi!
> how can i get the output generate in a .jsp inside an action like it 
> was a resource that i can process(a String or something else)???
> thanks a lot in advance.
>
> PD: I need to call jasper compiler or something similar? what can i do

> that? thanks
>
>
> -
> 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]
>
>
>
>   

hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot


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


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



RE: html inside an action

2004-03-25 Thread Brendan Richards
I'm not entirely sure what you're after - do you mean get a string with
the contents populated by another jsp - independent from the current
request being served?

I created a test jsp in tomcat containing a  tag, ran it
and looked in tomcat's work folder at the servlet code generated for it.

The key line of code seems to be

JspRuntimeLibrary.include(request, response, "/myInclude.jsp", out,
true); 


Here's the javadoc. Looks like it's specific to Tomcat though - I don't
know if there's a cross-platform solution.

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper/docs/api/org/apac
he/jasper/runtime/JspRuntimeLibrary.html


looks like the "out" is a JspWriter. I think you may be able to extend
jspWriter to create a jsp writer that captures your string rather than
sending to a response.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED] 
Sent: 25 March 2004 16:00
To: Struts Users Mailing List
Subject: html inside an action

hi!
how can i get the output generate in a .jsp inside an action like it was

a resource that i can process(a String or something else)???
thanks a lot in advance.

PD: I need to call jasper compiler or something similar? what can i do 
that? thanks


-
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: html inside an action

2004-03-25 Thread Qureshi, Affan
HttpUnit is also a neat tool which might help. Have a JSP generate the HTML and access 
that using HttpUnit (or a simple URLConnection/Socket for that matter). And you can 
get the generated HTML in your Action. 

I hope I understand you this time.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:54 AM
To: Struts Users Mailing List
Subject: Re: html inside an action


hi
Those are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on my 
action , is it possible? thanks a lot ,
Regards.


Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally you 
shouldn't be doing any client-side stuff in your Actions.
A cleaner approach would be to use Custom Tags to have the HTML 
generation code and you can call them from your JSPs. (Remember that 
JSPs are not sent to the browser, it is the code they generate that is 
sent to the client browser).
Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action


Qureshi, Affan wrote:

 

> What part of JSP do you want to generate? Is it Java code in the JSP 
> that you want to generate or static HTML/JavaScript? You might want to 
> look at Tag Libraries as well.
>
>
> -Original Message-
> From: ruben [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 10:00 AM
> To: Struts Users Mailing List
> Subject: html inside an action
>
>
> hi!
> how can i get the output generate in a .jsp inside an action like it 
> was a resource that i can process(a String or something else)???
> thanks a lot in advance.
>
> PD: I need to call jasper compiler or something similar? what can i do 
> that? thanks
>
>
> -
> 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]
>
>
>
>   

hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot


-
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: html inside an action

2004-03-25 Thread Hookom, Jacob
You are much better off doing JSP tags for something like this.  I don't
understand why people are so afraid of doing custom tags?

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 25, 2004 10:54 AM
To: Struts Users Mailing List
Subject: Re: html inside an action

hi
Those are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on my 
action , is it possible? thanks a lot ,
Regards.


Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally you 
shouldn't be doing any client-side stuff in your Actions.
A cleaner approach would be to use Custom Tags to have the HTML 
generation code and you can call them from your JSPs. (Remember that 
JSPs are not sent to the browser, it is the code they generate that is 
sent to the client browser).
Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action


Qureshi, Affan wrote:

 

> What part of JSP do you want to generate? Is it Java code in the JSP 
> that you want to generate or static HTML/JavaScript? You might want to 
> look at Tag Libraries as well.
>
>
> -Original Message-
> From: ruben [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 10:00 AM
> To: Struts Users Mailing List
> Subject: html inside an action
>
>
> hi!
> how can i get the output generate in a .jsp inside an action like it 
> was a resource that i can process(a String or something else)???
> thanks a lot in advance.
>
> PD: I need to call jasper compiler or something similar? what can i do 
> that? thanks
>
>
> -
> 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]
>
>
>
>   

hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot


-
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: html inside an action

2004-03-25 Thread ruben
hi
Those are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on my 
action , is it possible? thanks a lot ,
Regards.

Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally you 
shouldn't be doing any client-side stuff in your Actions.
A cleaner approach would be to use Custom Tags to have the HTML 
generation code and you can call them from your JSPs. (Remember that 
JSPs are not sent to the browser, it is the code they generate that is 
sent to the client browser).
Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action
Qureshi, Affan wrote:



What part of JSP do you want to generate? Is it Java code in the JSP 
that you want to generate or static HTML/JavaScript? You might want to 
look at Tag Libraries as well.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:00 AM
To: Struts Users Mailing List
Subject: html inside an action
hi!
how can i get the output generate in a .jsp inside an action like it 
was a resource that i can process(a String or something else)???
thanks a lot in advance.

PD: I need to call jasper compiler or something similar? what can i do 
that? thanks

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


  
hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot

-
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: Automatically detecting struts-config changes and reload app.

2004-03-25 Thread Kris Schneider
Seems like somebody ought to point out that calling lifecycle methods (like
Servlet.init and Servlet.destroy) from app code is generally a bad idea. OTOH,
if it works for you...

Quoting Pady Srinivasan <[EMAIL PROTECTED]>:

> 
> I made a small change to the code where setting WEB-INF in the classpath is
> not required.
> 
>   private long lastModified = 0;
>   private void reloadConfig(HttpServletRequest request) {
>   if ( System.getProperty("DEVELOPMENT_MODE") != null ) {
> try {
> File f = new
> File(request.getSession().getServletContext().getRealPath("/WEB-INF/struts-c
> onfig.xml"));
>  if ( f.lastModified() != lastModified ) {
> ActionServlet as = ( (ActionServlet)
> request.getSession().getServletContext().getAttribute(
> Globals.ACTION_SERVLET_KEY));
> as.destroy();
>  
> request.getSession().getServletContext().removeAttribute(Globals.REQUEST_PRO
> CESSOR_KEY);
> as.init();
> System.out.println("Reload ok.");
> }
> lastModified = f.lastModified();
> }
> catch (Exception ex) {
> ex.printStackTrace();
> }
>   }
>   }
> 
> Thanks
>  
> -- pady
> [EMAIL PROTECTED]
>  
> 
> -Original Message-
> From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 25, 2004 9:37 AM
> To: Struts Users Mailing List
> Subject: RE: Automatically detecting struts-config changes and reload app.
> 
> 
> I used your code ( Thanks ) and I finally got it to work with a Filter. We
> have a login filter in our app. So I added a method which runs only in
> development mode. 
> 
> * Set the DEVELOPMENT_MODE system property during development.
> * Add the WEB-INF directory to the classpath. ( does Tomcat include this in
> the classpath ? )
> * Call this method from the doFilter() method in your filter.
> 
>   private long lastModified = 0;
>   private void reloadConfig(HttpServletRequest request) {
>   if ( System.getProperty("DEVELOPMENT_MODE") != null ) {
> try {
> URL url = LoginFilter.class.getResource("/struts-config.xml");
> if ( url == null )
> return;
> File f = new File(url.getFile());
> if ( f.lastModified() != lastModified ) {
> ActionServlet as = ( (ActionServlet)
> request.getSession().getServletContext().getAttribute(
> Globals.ACTION_SERVLET_KEY));
> as.destroy();
>  
> request.getSession().getServletContext().removeAttribute(Globals.REQUEST_PRO
> CESSOR_KEY);
> as.init();
> System.out.println("Reload ok.");
> }
> lastModified = f.lastModified();
> }
> catch (Exception ex) {
> ex.printStackTrace();
> }
>   }
>   }
> }
> 
> 
> 
> 
> Thanks
>  
> -- pady
> [EMAIL PROTECTED]
>  
> 
> -Original Message-
> From: Leonardo Francalanci [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 25, 2004 7:19 AM
> To: Struts Users Mailing List
> Subject: R: Automatically detecting struts-config changes and reload app.
> 
> I wrote the following on 01/23/2004 on the mailing list, but nobody cared...
> 
> 
> 
> 
> 
> I wrote a servlet to trigger off a reload of the struts-config.xml.
> 
> The servlet is:
> 
>   protected void doGet(..) {
> 
>   ActionServlet as =
> ((ActionServlet)request.getSession().getServletContext().getAttribute(Global
> s.ACTION_SERVLET_KEY));
>   as.destroy();
> 
> request.getSession().getServletContext().removeAttribute(Globals.REQUEST_PRO
> CESSOR_KEY);
>   as.init();
> 
>   new PrintStream(response.getOutputStream()).println("Reload
> ok.");
>   }
> 
> 
> Now my questions...
> 
> 1) Is there another way to trigger off a reload without using the Tomcat's
> reload
> function (which takes a very long time and leaves db connections open?)
> 
> 2) I had to call removeAttribute(Globals.REQUEST_PROCESSOR_KEY) because the
> destroy method
> of the ActionServlet doesn't do it. Here is the code (from
> ActionServlet.destroyModules()):
> 
> [..]
> if (value instanceof ModuleConfig) {
> ModuleConfig config = (ModuleConfig) value;
> getRequestProcessor(config).destroy();
> 
> getServletContext().removeAttribute(name);
> 
> I think there should be something like
> 
>

Re: html inside an action

2004-03-25 Thread ruben
hi
These are my requirements, i have to convert objects to html, in my 
action and get this html in a String, i thought that the jsp is a good 
way to do this,
I want the code that   jsp generate (that is sent to the browser) on my 
action , is it possible? thanks a lot ,
Regards.

Qureshi, Affan wrote:

So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. 

A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). 

Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action
Qureshi, Affan wrote:

 

What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:00 AM
To: Struts Users Mailing List
Subject: html inside an action
hi!
how can i get the output generate in a .jsp inside an action like it was 
a resource that i can process(a String or something else)???
thanks a lot in advance.

PD: I need to call jasper compiler or something similar? what can i do 
that? thanks

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


   

hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot

-
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: Struts tag problem (bean:message and bean:write)

2004-03-25 Thread Paul McCulloch
Something like







Paul

> -Original Message-
> From: Marco Mistroni [mailto:[EMAIL PROTECTED]
> Sent: 25 March 2004 16:03
> To: 'Struts Users Mailing List'
> Subject: Struts tag problem (bean:message and bean:write)
> 
> 
> Hi all,
>   I was wondering if anyone of you have a solution
> For this dilemma.
> I have a collectin of product DTOs to show on my jsp. One of 
> DTO's property is, let's say, the type, which is listed in number.
> (let's say, 10 or 20).
> ON the DTO I will have the value 10,20 ecc but on the jsp I have to
> display
> The corresponding string (let's say, HouseProduct or Car or something
> else) which is listed in application.resources.
> 
> I am looping thru the collection using logic:iterate, and
> as I have found out myself, following code does not work
> 
> 
> 
> 
> basically in app.resources I will have
> prompt.productType.10=HouseProduct
> prompt.productType.20=Car
> 
> etc..
> 
> above, I am outputting the message   prompt.productType.(productType)
> 
> how can I solve my dilemma, keeping in mind that I am using also
> logic:iterate to loop thru the collection?
> 
> With best regards
>   marco
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


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



RE: html inside an action

2004-03-25 Thread Qureshi, Affan
So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be 
doing any client-side stuff in your Actions. 

A cleaner approach would be to use Custom Tags to have the HTML generation code and 
you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it 
is the code they generate that is sent to the client browser). 

Or maybe I dont understand your requirements.

Regards.

-Original Message-
From: ruben [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 10:19 AM
To: Struts Users Mailing List
Subject: Re: html inside an action


Qureshi, Affan wrote:

>What part of JSP do you want to generate? Is it Java code in the JSP that you want to 
>generate or static HTML/JavaScript? You might want to look at Tag Libraries as well.
>
>
>-Original Message-
>From: ruben [mailto:[EMAIL PROTECTED]
>Sent: Thursday, March 25, 2004 10:00 AM
>To: Struts Users Mailing List
>Subject: html inside an action
>
>
>hi!
>how can i get the output generate in a .jsp inside an action like it was 
>a resource that i can process(a String or something else)???
>thanks a lot in advance.
>
>PD: I need to call jasper compiler or something similar? what can i do 
>that? thanks
>
>
>-
>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]
>
>  
>
hi, thanks for the response, i want the code generated 
(HTML/javascript), it's like redirect the output to a resource that i 
can process in the action instead of send to the navigator,
thanks a lot


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



  1   2   3   4   5   6   7   8   9   10   >