Re: Struts2: Ajax Pagination using JQuery

2008-06-27 Thread David Durham, Jr.
On Fri, Jun 27, 2008 at 1:43 PM, Raghu <[EMAIL PROTECTED]> wrote:
> Hi, I want to implement ajax pagination on my struts2 page but I am not sure
> how to implement that. I am not very good in javascript and jquery but
> learning them..
>

You might be interested in something like this:

http://webplicity.net/flexigrid/

Regards,
Dave

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



Re: [OT] UML and Reverse Engineering

2008-04-11 Thread David Durham, Jr.
>  A good opensource option is Poseidon for UML (http://www.gentleware.com/).
> The community edition is free but that edition doesn't include Java->UML.

Poseidon and ArgoUML share a common codebase.  Argo does Java -> UML,
and I think the community edition of Poseidon does as well, but I'm
possibly wrong on this point.

-Dave

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 1:39 PM, akash agrawal <[EMAIL PROTECTED]> wrote:
>  It is a Boolean property but I still think it should work no matter whether 
> it is boolean or Boolean. APIs I am using are not mine so I can't change the 
> bean, but there are workaround I can put in although they aren't pretty. I 
> was hoping something can be done on the framework (Struts2) side.

Ask not what the framework can do for you, but what you can do for the
framework ...   it's Friday.  Seriously though, if you need to provide
a getMyBoolean, and you can't modify the original class, you can just
provide a wrapper to translate getMyBoolean to isMyBoolean.  If it's a
public class as I think the JavaBean spec requires it to be, you can
just extend it, otherwise you need a delegator for not just this
property but all the others.  Anyway, it's not really clear that this
is what you need anyway, so this is just more speculation.


--Dave

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 1:17 PM, akash agrawal <[EMAIL PROTECTED]> wrote:
> myBean is not null, There are other field which are not boolean and I do get 
> them fine.

Is it boolean, or Boolean?  I've seen situations where I was hoping
isX would return a reference to a Boolean (when reference with
JavaBean dot notation), but I had to implement a getX instead.  Just 2
cents.

-Dave

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



Re: [OT] What do you code today?

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 6:14 AM, Ted Husted <[EMAIL PROTECTED]> wrote:
>  So, if anyone else is up for sharing, I'd be interested in hearing
>  what sort of things other people are doing these days. (If your not
>  comfortable posting the list, feel free to mail me direct.)

I'm working with python  and plone these days, and I'm completely out
of my element.  It's kind of refreshing.

I wrote a little Plone product (really just modified some examples and
asked a lot of questions in irc :)) which facilitates integrating
external applications within a Plone site.  Check it out here:

  http://plone.org/products/contentcaller

You can use it to include a JSP or servlet or whathaveyou in a Plone
page.  There's also support for GWT.  I'm just getting started with
that, but it's kind of interesting.  A bit tangential, but Plone has
workflows as well, only they're visibility centric.

I also wrote a java library that can be used to automagically create
Java Beans from an excel file or csv.  You can see that here:

   http://code.google.com/p/beanfiles/

My employer graciously allowed me to opensource the beanfiles tool.
Maybe someone here will find it useful.  If not, doesn't bother me at
all. :)

--Dave

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



Re: File Upload problem

2008-03-19 Thread David Durham, Jr.
On Wed, Mar 19, 2008 at 5:19 AM, udaykumar <[EMAIL PROTECTED]> wrote:
>
>  I am using struts and have an upload.jsp and its associated UploadForm.java
>  and UploadAction.java. The jsp's form has an enctype=multipart/form-data and
>  contains an html:file field to upload a file as well as a bunch of text
>  fields for metadata associated with the file. If an error occurs during
>  validation, the struts controller servlet forwards to the jsp with error
>  messages. The problem is that the filepath the user specified is no longer
>  present. Is there a way to restore this value so the user doesn't have to
>  complete this field again (the other text fields remain filled in). Thanks
>  in advance

The issue is that inputs of type file are read-only to unsigned
javascript programs and of course the value attribute does not apply.
Otherwise, a page could try to hide a file input on a form with a
preset value of /etc/shadow or some other sensitive file, and have a
user unknowingly upload this file.

-Dave

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



Re: unexpected behavior with a checkbox.

2008-01-10 Thread David Durham, Jr.
> > The issue is that an unchecked checkbox does not send a value when a
> > form is submitted, so:
>
> This depends on (a) whether or not we're talking about S2 and (b) if we are
> whether or not we're using an interceptor stack that includes the "checkbox"
> interceptor.

I just meant that an HTTP Server won't see a request parameter for an
unchecked checkbox [sic], because a W3C conforming HTML browser won't
send one [request parameter].  The checkbox interceptor seems kludgey
to me, but if it solves this problem for people in a mostly
transparent way, then it's a good thing.


-Dave

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



Re: unexpected behavior with a checkbox.

2008-01-03 Thread David Durham, Jr.
On Jan 2, 2008 10:59 PM, ravi_eze <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> the workaround works, but causes problems if the checkbox should be
> validated. More over the soln is based on assumptions that need not hold
> always.

Which solution are you saying is based on assumptions that need not
hold, and why?  I think you'll find that my solution wherein you 1)
you don't use session-scoped action forms (or the equivalent in s2)
and 2) you don't initialize checkboxes in action form initialization,
covers all bases, including validation.  Really, it's the only viable
option for struts 1, that I know of.  If the assumption that doesn't
hold is that you need session-scoped-like form behavior, then that's
easily resolved.

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



Re: unexpected behavior with a checkbox.

2008-01-02 Thread David Durham, Jr.
> >
> >request.getParameter("myUncheckedCheckbox") == null
> >
>
> Oh.. yuck.. but thanks David for that work around.  Tried it and it
> works for my purposes.

There are things that can be done to avoid to the ugly null check.

1. Don't initialize check-box fields.  No initial values.
2. Don't use session-scoped forms.

It sounds like you need to start with a blank or default form that has
a check-box checked.  Perhaps the user should receive spam?  :)  I
haven't thought about that case much, but it seems similar in that, if
you don't want to use an initial value for reasons previously
mentioned, you're faced with using some other means to indicate this
box is checked by default.  If you have a "display new form action,"
you can put a value on the form whereby the box will start out
checked.  This is different than defining an initial value.   So long
as you don't specify an initial value for check-box fields, and Struts
creates a new form object for each submission, the state of a
check-box is preserved within an ActionForm.

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



Re: unexpected behavior with a checkbox.

2008-01-02 Thread David Durham, Jr.
> Where the trouble comes in is if the field is unchecked which I thought
> would set the value of the Boolean to "false."  It doesn't, it remains
> as a true.
>
> How do I implement behavior where if the checkbox is unchecked it sets
> the corresponding property of the form to false?

The issue is that an unchecked checkbox does not send a value when a
form is submitted, so:

   request.getParameter("myUncheckedCheckbox") == null

You can run this check in an action, and modify forms appropriately.
I can say more on this topic, if you need, wrt. session-scoped forms
(and why you should not use them).

-Dave

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



Re: Char lib for Struts 1

2007-12-28 Thread David Durham, Jr.
On Dec 28, 2007 7:08 AM, Sebastian Göttschkes
<[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I'm trying to find a chart lib for Struts 1(.3.8). It should be something 
> small, easy to install and use. I just need pie charts in 2D, nothing special.
>
> Any suggestions?

It's not Struts specific but Google has a chart API.

http://code.google.com/apis/chart/

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



Re: Setting Session time out

2007-12-26 Thread David Durham, Jr.
On Dec 25, 2007 1:56 AM, Raghuveer <[EMAIL PROTECTED]> wrote:
> If session of login user expires or left unused for 15 minutes application
> should fire session expire page automatically.

This is something that is best accomplished from a client.

HTML allows you to specify meta data about a document.

   http://www.w3.org/TR/html401/struct/global.html#h-7.4.4

And since these documents are usually retrieved via HTTP, HTML meta
tags include an attribute for setting HTTP response headers.  The
particular HTTP header that's often used to accomplish the task of
"firing a session expire page automatically" is the "refresh" header.
Here's the result of a quick google search:

   http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm

> Any idea of how to handle this in my struts application?

Session expiration/timeout configuration is outside of the
responsibilities of a web framework like Struts.  Said configuration,
however, is specified by various servlets specifications.  You'll
likely end up modifying a web.xml to achieve your desired results.

-Dave

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



Re: [S2] dojo 0.9 and ***-conversion.properties

2007-08-02 Thread David Durham, Jr.
On 8/1/07, Oguz Kologlu <[EMAIL PROTECTED]> wrote:
> Unexpected Exception caught setting 'contacts%5B0%5D.firstName' on
> 'class easybed.web.struts2.ContactsAction: Error setting expression
> 'contacts%5B0%5D.firstName' with value '[Ljava.lang.String;@284bf3'
>
> Dojo 0.4.3 used to work ok (probably it didn't encode `[`
> characters). I realise this is a borderline S2 issue since it ships
> with 0.4.3 but it will eventually have to support 0.9 and will have
> to solve the issue.

Only thing I can think of is that maybe the parameter name is being
double escaped with JavaScript.  You might be able to test this by
manually forming a URL like:

   http://.../MyAction.do?contacts%5B0%5D.firstName=value

and seeing if the value is set properly in your action.  I think it
should be.  But, if you make the following request:

  http://.../MyAction.do?contacts%255B0%255D.firstName=value

which has the parameter name contacts[0].firstName in a double-escaped
form, maybe you can reproduce your error.  If the first URL is fine,
but the second URL fails with the exception you're seeing, then you're
double-escaping in your browser.  Could be a dojo bug, or just
something that's changed from 0.4.3 to 0.9 that users need to be aware
of.  Not sure.

HTH,

Dave

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



Re: [s2] broken in IE (was: [S2] Multiple Submits with different actions in a Form)

2007-07-26 Thread David Durham, Jr.

On 7/26/07, Dave Newton <[EMAIL PROTECTED]> wrote:

I thought IE's broken button behavior was already
documented, including on the wiki?


That may be.  Here's the rendered HTML:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>





   Cancel Test




   
   Submit



   
   Cancel



   





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



Re: [s2] broken in IE (was: [S2] Multiple Submits with different actions in a Form)

2007-07-26 Thread David Durham, Jr.

> Things like:
>
> 
> 
> 
> 
>
> work for me in firefox, but don't seem to work in IE.

Could you provide the rendered HTML that works in one browser but not the
other?


Sure.

TestCancel.jsp
--

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<%@ taglib prefix="s" uri="/struts-tags"%>



   Cancel Test


   
   
   
   



struts-config.xml
--
  
   /TestCancel.jsp?cancelled=false
   /TestCancel.jsp?cancelled=true
  

com.TestCancel

package com;

public class TestCancel {

   public String submit() {
   return "submit";
   }

   public String cancel() {
   return "cancel";
   }

}


Removing "type=button" will fix the IE issue.

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



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread David Durham, Jr.

On 7/25/07, Grish <[EMAIL PROTECTED]> wrote:


no, what happens is the action specified in the form is what's executed. I'm
using firefox as well.

here's my button:



I tried having the form specify one action and one button have to submit the
form, and another button (like the one above) to have the form submit to
another action. But it seems the action in the form overrides my button.


Things like:






work for me in firefox, but don't seem to work in IE.

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



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread David Durham, Jr.

On 7/25/07, Grish <[EMAIL PROTECTED]> wrote:

My problem though is I have a form with multiple submit buttons. I tried
specifying the action on each submit button but the action in my form
overrides the action specified in the buttons.


I have success with this technique in Firefox, but I think it's broken
in IE.  Is this what you're seeing?

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



Re: Struts 2 performance

2007-07-11 Thread David Durham, Jr.

On 7/11/07, Ing. Andrea Vettori <[EMAIL PROTECTED]> wrote:

Can anyone suggest how to "test" my site for performance analysis
(best with a simple free product) ?
I can show here the result if interested.


I haven't used it personally, but there's the Eclipse TPTP project
that works with the eclipse web tools platform via a seperately
downloaded plugin (tptp-wtp).

http://www.eclipse.org/tptp/

HTH,
Dave

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



Re: dispatcher setting encoding

2007-07-11 Thread David Durham, Jr.

On 7/11/07, Arnaud Cogoluegnes <[EMAIL PROTECTED]> wrote:

So it seems the filter dispatcher transforms the encoding for all files (if
configured with /* in web.xml), which can cause problem with UTF-8 and BOM.

Is there any way to exclude some files from the filtering ?


My first guess would be to change the /* to /*.do, or something to
that effect.  Consider this with the caveat that I don't fully
understand the FilterDispatcher.  I think that Filters can now (since
servlets 2.4, I think) be applied to RequestDispatcher.include/forward
calls, so it's possible that changing /* to /*.do would break some
result types or something else, for that matter, but I don't know for
sure.

HTH,

Dave

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



Re: [S2] Getting DAO from Spring in Struts Action

2007-06-21 Thread David Durham, Jr.

On 6/15/07, M. Bitner <[EMAIL PROTECTED]> wrote:

That got it working - thank you all so much for your help.


Turns out I was wrong, though, and it's the "class" attribute that has
to match up.  Been awhile since I looked at that.  Good that you
solved your problem, anyway.


-Dave





On 6/15/07, David Durham, Jr. <[EMAIL PROTECTED]> wrote:
> On 6/14/07, M. Bitner <[EMAIL PROTECTED]> wrote:
> > 
> > 
> Your action name has to correspond to your bean id, so:
>
> 
> or
>
> 

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



Re: [S2] Exporting to CSV and Excel

2007-06-18 Thread David Durham, Jr.

On 6/18/07, Jeff Amiel <[EMAIL PROTECTED]> wrote:

On 6/18/07, Skip Hollowell <[EMAIL PROTECTED]> wrote:
> I see that in the new 2.0.8 (Thanks Ted, Don and team) that the Jasper
> plugin is included.  Does that mean that Jasper is the endorsed
> recommended way to export data to Excel and or CSV?  If so, great.  If
> not, can you offer up what you feel is a preferred mechanism for
> exporting to Excel?

I personally use display tag (http://displaytag.sourceforge.ne) which
has fine excel, csv and pdf export mechanism.  It all depends on what
you are trying to 'export'.


Both of these tools use Apache POI  as an
underlying Excel format  generator.  I wouldn't use Jasper as an Excel
generator, unless I were already using or intended to use Jasper as a
reporting engine.  Display tag is only applicable, in this case, if
you need tabular data within a JSP along with an option to export in
Excel format.

POI is fairly easy to use, I've found, but it does have some memory
related problems associated with very large excel files.

-Dave

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



Re: [S2] Getting DAO from Spring in Struts Action

2007-06-15 Thread David Durham, Jr.

On 6/14/07, M. Bitner <[EMAIL PROTECTED]> wrote:






Your action name has to correspond to your bean id, so:



Re: [S2] Getting DAO from Spring in Struts Action

2007-06-14 Thread David Durham, Jr.

On 6/14/07, Wesslan <[EMAIL PROTECTED]> wrote:

Maybe http://struts.apache.org/2.x/docs/spring-plugin.html can be of some
help.


You have to give your spring actions (those you want dependency
injection for) the same value for the "name" attribute as the value
you give for your spring bean's "id" attribute.  This is spelled out
in the referenced document, but I missed that point the first time
through.

HTH,
Dave

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



Re: Extending DynaValidatorForm

2007-06-11 Thread David Durham, Jr.

On 6/11/07, Ambaris Mohanty <[EMAIL PROTECTED]> wrote:

My code is as following...
struts-config.xml









Is this something where just adding "initial" will work for you?



This will affect the behavior of an html-reset control, because it
determines the initial value of new form elements.

Otherwise, if you're going to actually override
DynaValidatorForm.reset, something like this might work for you
(method signature truncated) :

reset(mapping, request) {
  set("username", "");
}

This is one step removed from the html-reset control, because it will
be executed within your servlet context, *not* from within a browser.

What's the actual problem you're trying to solve.

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



Re: Extending DynaValidatorForm

2007-06-08 Thread David Durham, Jr.

On 6/8/07, David Durham, Jr. <[EMAIL PROTECTED]> wrote:

On 6/8/07, Ambaris Mohanty <[EMAIL PROTECTED]> wrote:
> Please someone send me the sample code for extending DynaValidatorForm and
> implementing the reset method. I have no idea on how to do it. Please help.
> I'm using struts 1.2.9.
> Thank you,


HTML has the concept of a reset button:

   http://www.w3.org/TR/html401/interact/forms.html#reset-button

...


Hmm, guess you were asking about extending DynaValidatorForm.  I must
have been thinking of some other question that was similar to this
one.  Anyway, a DynaValidatorForm is a DynaBean, so you can call
set("propertyName", "reset Value") from your reset override method.
These API versions aren't exact, but I don't think these classes have
changed much:

http://struts.apache.org/1.3.8/apidocs/org/apache/struts/validator/DynaValidatorForm.html
http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.6.1/docs/api/org/apache/commons/beanutils/DynaBean.html

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



Re: Extending DynaValidatorForm

2007-06-08 Thread David Durham, Jr.

On 6/8/07, Ambaris Mohanty <[EMAIL PROTECTED]> wrote:

Please someone send me the sample code for extending DynaValidatorForm and
implementing the reset method. I have no idea on how to do it. Please help.
I'm using struts 1.2.9.
Thank you,



HTML has the concept of a reset button:

  http://www.w3.org/TR/html401/interact/forms.html#reset-button

As stated in the link above, when a user activates a reset control,
the form values are set to their *inital values*.  This may not be the
reset behavior that you're looking for.

One way to implement a reset button that "clears" form element values
is with JavaScript.  You might do something like:

Reset


   function resetForm() {
   // acquire form reference, e.g.
   var myForm = document.forms['myForm'];

   // loop through elements
   for(var i = 0; i < myForm.elements.length; i++) {
  // check element type and implement reset
  //  your code goes here
   }
   }


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



Re: [OT] Serious memory leak

2007-05-30 Thread David Durham, Jr.

Maybe you're creating a new session with each request.

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



Re: eclipse struts2 projects "missing java project struts2-core"

2007-05-26 Thread David Durham, Jr.

On 5/26/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:

There's probably an easier way, but I just create the elipse project for the
project I want to use, like let's say, core and showcase, doing:

core/
mvn eclipse:eclipse

apps/showcase/
mvn eclipse:eclipse -Dwtpversion=1.0

and then import the projects, if you do it like that, you need to compile
core with maven because the reference in the showcase project will be
pointing to the M2_REPO folder. To compile core(configure it to run as an
external tool):


That works for the showcase app.  Wondering why the mvn
eclipse:eclipse goal will build the plugin projects' eclipse metadata
with a project dependency of struts2-core instead of core?  Does this
have something to do with an assumption that you would have
struts1-core in the same workspace?

Sounds like reasonable fixes are: 1) change project dependency from
struts2-core to core or 2) change to M2_REPO dependency instead of
project dependency and use mvn build.

1) Worked for me.

2) M2_REPO dependency is implied, at this point.

https://issues.apache.org/struts/browse/WW-1947


core/
mvn -Dmaven.test.skip=true install

I think there is a way to have maven generate the projects with the
references between them for eclipse, but I'm not sure how, we can put it on
the wiki if someone replies :)


Would like to have some more info about how you setup the maven build.
I couldn't get this plugin http://m2eclipse.codehaus.org/> to
play nice.  Nor was I successfully able to add a "Program" builder to
my project.

-Dave

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



eclipse struts2 projects "missing java project struts2-core"

2007-05-25 Thread David Durham, Jr.

Hi,

I checked out the struts2 trunk from svn and imported the struts
projects via import projects.  I see a list of projects: api, core,
struts2-codebehind-plugin, ...  I have an M2_REPO variable setup.
core and api build without errors, but all of the plugin projects fail
to build because they're missing the dependency project struts2-core.
What's the recommended procedure for setting up the plugin projects,
and the core and api for that matter.  I'm trying to follow these
documents:

http://struts.apache.org/2.x/docs/building-the-framework-from-source.html
http://struts.apache.org/2.x/docs/building-with-maven.html

Thanks,

Dave

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



Re: Problem with struts and jfree chart

2007-03-07 Thread David Durham

GulliGulli Bob wrote:

it works, when i add the jars as "external jars" (in eclipse), but now i have 
another problem. struts starts up without errors, but in runtime i get the following 
error:
...
javax.servlet.ServletException: org/jfree/util/PublicCloneable
at 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
at 
org.apache.jsp.erg_005foptimal_jsp._jspService(erg_005foptimal_jsp.java:226)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
...

jfreechart works without struts, so what that can be?



Should be a root cause in your log/output somewhere.  This error doesn't 
say much.  Maybe it's "class not found" since it seems like you removed 
the jfreechart and jcommon jars from your build.  You probably just want 
to flag gnujaxp.jar as "external".



-Dave

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



Re: Problem with struts and jfree chart

2007-03-06 Thread David Durham

>> From: GulliGulli Bob [mailto:[EMAIL PROTECTED]
>>
>> my struts application works fine before I put the
>> jfree-chart jars
>> (jfreechart-1.0.4.jar, jcommon-1.0.8.jar,
>> gnujaxp.jar) in the classpath.
>> Now I get the following errors:
>>
>> org.apache.commons.digester.Digester getParser
>> SCHWERWIEGEND: Digester.getParser:
>> org.xml.sax.SAXNotRecognizedException:
>> http://apache.org/xml/features/validation/dynamic
>>at
>>
Dave Newton wrote:

I would find it more likely that gnujaxp is the
culprit, particularly since the stack trace references
it explicitly, but I don't know what's in jcommon.



I think that the gnujaxp.jar specifies a SAXParserFactory implementation 
via the file:


 META-INF/services/javax.xml.parsers.SAXParserFactory

More info on the topic:

http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()

HTH,


-Dave

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



[s2] maven archetype + jasper plug-in

2006-11-21 Thread David Durham

A few questions all bundled into one e-mail.  First, I'm attempting to use the 
jasper plug-in for struts 2, and have a maven archetype as my starting point.  
I uncommented these lines in my pom.xml:

  
  jasperreports
  jasperreports
  1.2.1
  

I then followed this guide (I don't know of any difference between what I've 
done and what's in this tutorial):

 http://struts.apache.org/2.x/docs/jasperreports-tutorial.html

I get the following stack trace:

Error building results for action myJasperTest in namespace  - action - 
file:/home/ddurham/IdeaProjects/profileReports/target/profileReports/WEB-INF/classes/struts.xml:33:74
   
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:173)
   
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:248)
   
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:723)
   
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)
   
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:97)
   
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:46)
   
org.apache.struts2.dispatcher.mapper.DefaultActionMapper.getMapping(DefaultActionMapper.java:238)
   
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:227)
   
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
   
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
   
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:118)

This indicates there's a problem in this section of struts.xml:

  
  
  /jasper/compiled_template.jasper
  myList
  PDF
  
  

I checked that the struts2 jasper reports plugin and jasper reports jars are in my 
WEB-INF/lib directory, just in case the root cause is "no class definition 
found."  Speaking of root cause, I can't find it.  Here's my logging configuration.  
First the pom.xml modification:

  
  log4j
  log4j
  1.2.13
  

Now my log4j.xml (relevant entries only):

  
  
  
  

  
  
  
  


But I don't get DEBUG messages from struts in catalina.out.  I only see INFO 
messages.  I do see DEBUG messages from my action classes.  I haven't checked 
struts 2 source code to see if there are any DEBUG statements (just assuming 
that there are).  So, anyone working with struts 2 and jasper?  My biggest 
problem is not seeing log messages from these classes.  Thanks for any help,

Dave

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



Re: Struts2/WebWork and tagdir style tags?

2006-11-21 Thread David Durham

DNewfield wrote:

David Durham wrote:

I didn't think s2 or ww had its own EL syntax.


You're right, of course.  This is simply one of a number of places where the
subtle differences between "%{FOO}", "${FOO}", "FOO", etc. (and locations
where they're appropriate) has me confused.

Any advice to un-confuse me?


I haven't done much in the way of tag authoring...  sorry.


-Dave

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



Re: [s2] maven archetype + jasper plug-in

2006-11-21 Thread David Durham

David Durham wrote:

Now my log4j.xml (relevant entries only):

  
  
  
  

  
  
  
  


But I don't get DEBUG messages from struts in catalina.out.  I only see 
INFO messages.  I do see DEBUG messages from my action classes.  I 
haven't checked struts 2 source code to see if there are any DEBUG 
statements (just assuming that there are).  So, anyone working with 
struts 2 and jasper?  My biggest problem is not seeing log messages from 
these classes.  Thanks for any help,


Meh, classic mvn clean + mvn install vs. merely mvn install, problem.  I had a 
stale log4j.xml in my target.  I'm seeing a lot of debug messages at this 
point.  Anyway, still have the jasper issue.  Perhaps someone is working with 
struts2-jasper-plugin and can spot something from my previous e-mail.  
Otherwise, I'll indicate what I find out, as it may be useful for updating that 
tutorial.



-Dave


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



Re: Struts2/WebWork and tagdir style tags?

2006-11-21 Thread David Durham

DNewfield wrote:

Has anyone on this list had success creating .tag files under tomcat5.5 (with
2.4) with struts2 or webwork2?

I can create and use them simply enough, as long as I don't try to pass in
anything as an attribute.  I cannot figure out any syntax (${bar}, %{bar},
#bar, bar, etc.) that allows me to pass in objects to the tag. I can do so
by pushing the relevant objects on to the top of the ongl stack, but that is
pretty ugly and seems fragile.  I've found a number of articles about
creating .tag files, but none specific to struts2/webwork2 which has it's
own el-style syntax (that seems to work in .jsp files, but not in .tag
files).


Um, struts2/webwork2 has it's own el-style syntax?  I thought they depended on 
the result type for EL.  Freemarker results have #.. syntax along with 
JSTL-like ${object.hash.scalar} syntax and presents tags with request, session, 
application ... scopes even though freemarker itself has only a few scopes, 
function/macro local, template global, and maybe others.  I'm no freemarker 
expert, and certainly not a struts2 expert, but I didn't think s2 or ww had its 
own EL syntax.

-Dave

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



Re: DownloadAction and concurrent threads

2006-09-14 Thread David Durham

David Durham wrote:

David Grundberg wrote:


Actually, Oliver Meyn wrote the following question.  My apologies to 
David Grundberg for misquoting.


My app needs to allow downloads of relatively large files (10MB). 
Because Struts can/will reuse Actions for different threads, I'm 
worried that when multiple requests attempt to download these big 
files that a single "BigFileDownloadAction" will block until a 
download is complete thereby slowing all downloads (effectively 
making them serial).  Am I missing something?



-Dave

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



Re: DownloadAction and concurrent threads

2006-09-14 Thread David Durham

David Grundberg wrote:
My app needs to allow downloads of relatively large files (10MB). 
Because Struts can/will reuse Actions for different threads, I'm 
worried that when multiple requests attempt to download these big 
files that a single "BigFileDownloadAction" will block until a 
download is complete thereby slowing all downloads (effectively making 
them serial).  Am I missing something?


Why worry?  Benchmark it and find out.  I like Jmeter, but maybe someone 
else on the list can recommend a better tool.


As it stands, you have not described anything that would require a 
blocking execute method in your action.  From what you've stated, you 
will likely see some disk IO contention.  Again, benchmarking will tell 
you what your system can handle, and whether or not you need to 
optimize.  Why optimize unless you're sure you need to.  And, if you're 
going to optimize, it's nice to have a way to measure.



-Dave

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



Re: DynaValidatorForm

2006-09-12 Thread David Durham

leo mj wrote:

mallik,

 use java.lang.Integer for integer and java.util.GregorianCalendar  for Time.


Yeah, but you don't really want to do that, either.  You're best bet is 
to use String types for form-bean values, and convert to a different 
type while handing off to a model layer.  Reasoning is that you don't 
want to lose a user's input while displaying a form validation error. 
This is how it used to be anyway, maybe there's a new feature that's 
changed this?  Assuming there isn't, use Strings in form-beans, and 
convert to more specific types further down the chain in the request 
processing.



-Dave

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



Re: Double Execution of Struts Actions

2006-09-08 Thread David Durham

Daniel Chacón Sánchez wrote:

thanks Frank and Juan Pablo,

Ok let me explain better (by the way, sorry for my english...)


Yes Juan Pablo i have this javascript:

function *cambiarAction*(formulario, action){
 formulario.action = action;
 formulario.submit();
 return false;
}

But not i don´t call it on a 

Try:

function cambiarAction(...) {
   ...
   return false;
}

..

-Dave

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



[friday] Re: Geronimo ??

2006-09-08 Thread David Durham

A. Lotfi wrote:

Hi,
  I have a simple question, what's the difference between Tomcat and  Geronimo ?


Think you misspelled TomKat, a 'celebrity couple portmanteau' for Tom Cruise 
and Katie Holmes.

  http://en.wikipedia.org/wiki/Tomcat

Geronimo himself was a Bedonkohe Apache.

  http://en.wikipedia.org/wiki/Geronimo


-Dave

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



Re: [HELP][Struts 2] problem initializing hibernate in spring xml file

2006-09-08 Thread David Durham

This is a mysql related issue.

Garner Shawn wrote:

ERROR main org.hibernate.tool.hbm2ddl.SchemaExport - Access denied
for user: '[EMAIL PROTECTED]' to database 'agejsoft'
ERROR main org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful:
create table products (product_id integer not null auto_increment,
product_name varchar(255), product_desc varchar(255), curr_max_version
integer, curr_min_version integer, thumb_url varchar(255),
screenshot_url varchar(255), meta_keywords varchar(255),
meta_description varchar(255), primary key (product_id)) type=MyISAM


Seems like there should be say localhost where the percent is.  Any help?

Shawn

-
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: Retrieve Data List

2006-09-06 Thread David Durham

Rokariya, Raman wrote:
Hi, 
I am developing Web Client using Struts framework. I am facing problem
in following scenarios. 
My application has a Pop Up Window which refreshes after some regular

interval (minutes). The first time when the window opens, the data which
is displayed in 
Tabular Grid is fetched through the Web service Call from the Database. 
Now, during subsequent refreshes of the window , I don't want to perform

the Database hit (web service call). The Data to be loaded in tabular
grid (I am using displayTag library) should be available From the Web
Server. 
I have tried using the Session object. It works fine. However, we want

to avoid using the Session object due to its limitations.
I have also tried using ThreadLocal object. But during refresh of the
page, the list which was stored in ThreadLocal during first call of the
web service, is lost.
I am sure someone may have faced similar problems before, Any ideas to
solve the above problem would be helpful and appreciated.



This isn't a struts specific issue, so perhaps this is not the best list 
for your question.  In general, you've entered into the domain of 
"caching," and the problem is rarely so simple as "which object should 
hold this data."  However, if you're looking for a web application scope 
to use in order to reduce data retrieval, and you have a relatively 
small ResultSet, then "application" and "sesion" are likely candidates. 
 Using ThreadLocal is not a good idea for caching beyond the lifecycle 
of a single "request," SFAIK.


So maybe look at display tag's implementation of the value list pattern, 
and search for a caching framework.  Struts does not provide this feature.



-Dave

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



Re: Mapping between a request parameter name and a Struts form property name

2006-09-05 Thread David Durham

David Friedman wrote:

You jogged my memory and I have a solution from the Appendix of "Struts In
Action."  Version 1.1 and onward (possibly even in 1.0), struts
ActionMappings have had two attributes: "prefix" and "suffix." The are from
the ActionConfig class but carry over to the ActionMapping class used by the
Struts-Config.xml. Their use would be (you probably shouldn't mix them as in
this stupid example):




The JavaDocs from the ActionConfig class (ActionMapping extends it) are:

Prefix used to match request parameter names to form bean property names, if
any.
Suffix used to match request parameter names to form bean property names, if
any.

So how/why would you use it?  Do you plan on having a wizard where some
field names are the same on different pages?  That way page 1 variables
could be oneId, oneTextField, etc. then page two could be
twoId, twoUsername, twoPassword, and page3 could be threeId,
threeShippingAddr1, etc. all within the same ActionForm/Pojo?  If that is
the case I guess it could make wizards easier and avoid variable collision.


That's an interesting feature.  I missed that while looking at the 
RequestUtils.populate method, skipping straight to BeanUtils.populate. 
From the source, it looks like request parameters are skipped 
altogether if their prefix and suffix do not match a specified config 
(if one exists), so you can't pick and choose which parameters will have 
a prefix and suffix.  All or nothing option.



-Dave

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



Re: Mapping between a request parameter name and a Struts form property name

2006-09-01 Thread David Durham

Andrey Falaleev wrote:

Hello everybody,

I'd have the following question: Let's suppose I call a Struts action, which is bound to a particular form through struts-config.xml. As far as I know, the request is being analysed internally by Struts at the beginning, such that for each form property the corresponding request parameter is searched by name. E.g., if there is a property 'id' in a form, the reqest is analysed for an 'id' parameter. Am I right? 


The question is: may I specify a request parameter name for the particular form 
property manually? E.g., to tell Struts that for the form property 'id' I would 
like to use the request parameter 'objectId'?


I don't think this is possible in struts without serious modifications. 
  Perhaps with a composable request processor, but as it stands, I 
think the following method is employed:


  http://tinyurl.com/k9f69

and it basically copies based on property names.  I question the 
validity of this request parameter to bean property map.  Seems easier 
and reasonable to impose matching names.



-Dave

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



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

2006-08-30 Thread David Durham

[EMAIL PROTECTED] wrote:

Hello!


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

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

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

href=some.jsp;sessionid=E19593A3AB3BB4EBB92C6E64916B729C

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



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


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



-Dave

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread David Durham

Tom Bednarz wrote:

So I used



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


  http://tinyurl.com/zp6ag

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


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


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



-Dave

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



Re: validator and DynaValidatorActionForm

2006-08-30 Thread David Durham

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


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






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

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














and the following action mapping:


  
  



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




  

  
  

  
  

  
  

  
  

  
  

  
  


  


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


Here is an extract of the JSP:


  

   


  


   

  
  

  


  


  

  
  ...

 

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


Does anybody know what is going wrong here??

Many thanks for your help!

Tom


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




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



Re: Unable to validate two different checkbox, through validation.xml

2006-08-15 Thread David Durham

Nilesh Sinha wrote:
I have two different checkbox field in form. fields Property is boolean. I 
want to validate the form as: User should check at least one of the checkbox.


Relevant info in the "Designing Complex Validations with validwhen" 
section of this document:


  http://struts.apache.org/1.2.9/userGuide/dev_validator.html

There's also a guide to using "requiredif" under the section titled 
"Conditionally required fields".



-Dave

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



Re: Choices, choices...How does one choose a taglib for displaying tables?

2006-08-15 Thread David Durham

pantichd wrote:

Some would say that variety is good and I agree but I also want to make sure
we choose something that will work well with Struts and will be
supported/enhanced going forward.


I think displaytag is a reasonable choice.  There are displaytag forums 
and displaytag mailing lists hosted by sourceforge.  You may get more 
help there.  But, if you look in displaytag.tld (it's in META-INF/ of 
displaytag.jar), the JSP version is 1.2 (I'm referring to 
displaytag-1.1), so maybe you can give that info to your vendor with the 
hope of getting a more helpful response.  Another thing to try is 
deploying the displaytag examples war included in the binary (not sure 
about source) distribution.  If that works, then you can get your app to 
work.  If the example app doesn't work, then the problem is likely a bit 
more tricky to find.


Another option is to use an older version of displaytag.  Realise you're 
looking for something that will be "enhanced going forward," but you may 
need to drop that aspect of your requirements if you're tied to older 
versions of the Servlets and JSP specs (but not necessarily).



-Dave

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



Re: Getting maxFileSize from Controller in a JSP

2006-08-11 Thread David Durham

Adam Gordon wrote:
Is there a way to reference the controller for a module from within a 
JSP?  Specifically, I'd like to ask the controller what the max file 
size is set to.  There's a method on the ControllerConfig class to get 
the max file size and the Javadocs say it's a JavaBean so I suspect it 
might available from within a JSP, I just don't know the name 
(controller?) of the bean to reference in the JSP.


There's a module config that's stored as a request attribute.  THe key 
is in the Globals class, I think it's MODULE_KEY.  It has a reference to 
a controller config.  Little utility method to find what's in request 
attributes:


public static void debugRequestAttributes(HttpServletRequest request) {
Enumeration attributeNames = request.getAttributeNames();
while (attributeNames.hasMoreElements()) {
String a = attributeNames.nextElement();
log.debug(a + ": " + request.getAttribute(a));
}
}


-Dave

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



html:link and post instead of get

2006-08-11 Thread David Durham
Is there a common way to change an  or  from a get 
to a post http request?  Looks like it would have to replace an href=""> with a form.  RoR does this easily enough.  One idea would 
be to add a method="post|get" option to  or something similar 
to that.



-Dave

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



Re: How to retrieve parameters off URL in JSP via Struts

2006-08-10 Thread David Durham

Adam Gordon wrote:
A, if only the taglib docs were documented in a more thorough 
manner


Since I wanted to render some Struts tags based on the presence of a 
parameter, I discovered the "logic:present" element and used the 
"parameter" attribute.  Hooray for me!


It's possible to use EL:

${param.paramName}

So,



But, that's not Struts.


-Dave

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



Re: html:checkbox issue

2006-08-10 Thread David Durham

Adam Gordon wrote:
I've got an html:checkbox in a form and the property is mapped/spelled 
correctly to the field/method in the bean.  The behavior I am seeing is 
that the bean property (a boolean) is not being set based on the state 
of the checkbox.


I fired up Ethereal and following the TCP stream from the POST, I can 
see the name of the property being passed (=on) as a 
parameter on the request if the checkbox is checked, but if it is not 
checked, the parameter doesn't show up at all on the request (I'd 
expected =off) but this might be the reason that Struts 
can't set the property if it doesn't know the value


Obviously, I can issue a request.getParameter() and if it 
returns null, set the property on the bean myself, but I had hoped 
Struts would do this for me...


Anyone run into this before or have any suggestions?  Thanks.


Try using multibox.  I think it will do what you need.

http://husted.com/struts/tips/007.html

-Dave


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



Re: sample class which extends ActionServlet

2006-07-21 Thread David Durham

>>Please send the sample class which extends to Action Servlet!!
>
> For providing the authorization
>

It's better doing with Filters...



Filters, yes, but there's a processPreProcess extension point in 
RequestProcessor.


I think Servlets 2.2 doesn't have filters, but who uses that old thing?


-Dave

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



Re: Multiple struts-config files with wildcards

2006-07-19 Thread David Durham

Volker Krebs wrote:

I want to use wildcards. So it should look like this.

  config
  
/WEB-INF/struts*,
/WEB-INF/user/struts*
  


Has anyone some hints ?

I was thinking about extending org.apache.struts.action.ActionServlet
and overwriting parseModuleConfigFile(Digester digester, String path)


I think that extending ActionServlet and overriding its methods is 
generally not recommended.  I would just submit a feature request, if I 
were you, and go with a list for right now.  Just my 2 cents.



-Dave

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



Re: Grouping common actions

2006-07-18 Thread David Durham

chamal desilva wrote:

And is there a way that we
can add common functionality to all methods in
DIspatchAction class?



Suppose you could extend DispatchAction and implement an execute(...) 
method that does something then returns super.execute(...).



-Dave

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



Re: Does validator work with Lookup dispatch action

2006-07-12 Thread David Durham

mosho wrote:

I have few concerns using lookupdispatch action,
1. Will I be able to validate using struts validator?
2. I need to validate only when next button is hit, is that possible?

Is there any tutorial avialable for using lookup dispatch action.


I've done something similar by explicitly calling form.validate() from 
within the "execute" method, but this has a bad smell.  Someone else 
probably has a better approach.



-Dave


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



Re: Struts 1.2.x, How reference form.field if disallows form Name attribute?

2006-06-30 Thread David Durham

Mississippi John Hurt wrote:

Hi,
 no longer allows "name" attribute. Problem is I have javascript
that refers to a field on the form by the formName.fieldName. So now I 
get a
javascript error. If I can no longer assign a name to the form, then the 
big

question is how can I refer to a field on that form in javascript?? Help!



The "name" attribute comes from the struts-config, form-bean "name" 
attribute.


-Dave


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



Re: Eclipse plugin

2006-06-29 Thread David Durham

David Friedman wrote:

Also, if you are using Eclipse, I believe a new RELEASE version is coming
out in the next week (or sooner) so you might want to upgrade almost
immediately once it comes out in case it has any benefits (speed, new
features, better possible stability, etc.).


That's right, "Callisto is coming in 1 day."  I use Eclipse for my 
day-to-day work.  I haven't used Netbeans in awhile.  Anyway, the 
Eclipse Web Tools Platform works well enough for me in that it supports 
autocompletion of taglibs, and has some javascript support in addition 
to XML and HTML features.  I use ANT to build my projects and reload 
Tomcat Contexts.  I've also tried the Maven 2 plugin for Eclipse and 
it's kind of nice in that it pulls in dependencies and attachs the 
source for things like javadoc support and ctrl-clicking into API calls 
(among other things).  I opted against using the Maven 2 plugin for 
right now, though, because it seems a bit unintuitive in its current state.



-Dave

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



Re: Problem with one of the actions.

2006-06-26 Thread David Durham

javax.servlet.jsp.JspException: ServletException in '/audit.do': null
org.apache.jsp.WEB_002dINF.tiles.template_jsp._jspService(org.apache.jsp.WEB_002dINF.tiles.template_jsp:98)


Maybe there's a null pointer in template.jsp.

-Dave

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



Re: How to get the "ActionErrors" object reference ???

2006-06-21 Thread David Durham

Sanjeeb Patel wrote:

How do I get the "ActionErrors" object which have been saved in the
request.


http://struts.apache.org/struts-action/struts-core/apidocs/org/apache/struts/Globals.html


-Dave

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



Re: Opening a popup with same data as the main window

2006-06-21 Thread David Durham

Anjishnu Bandyopadhyay wrote:

Hi all,

I need to open a popup screen from a main window (on click of a button),
with the same data as the main window. (The purpose is that the popup
will serve a print preview screen for the data to be printed.)

I cannot go to the server back and fetch the data. (This needs to be
implemented at the client side only).

Any pointers in this respect will be very much helpful.


I used to do this type of thing in javascript with the window.opener object.

http://www.webreference.com/js/tutorial1/opener.html


-Dave

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



Re: How to implement autorefresh?

2006-06-14 Thread David Durham

Cassio Pereira wrote:

You should use javascript to post your form from time to time using
the function "window.setInterval(function, milliseconds)" that you can
read about at http://www.w3.org/TR/Window/#timers.

If ou don't want the flickering effect that it causes, you could also
use Ajax with the timer.


There's also the meta tag, that can be used to refresh a page 
automatically.  This technique is discouraged, though.  See:


   http://en.wikipedia.org/wiki/META_refresh


-Dave




On 6/14/06, Pankaj Gupta <[EMAIL PROTECTED]> wrote:


I need to call a method from the action class that periodically
refreshes my page in struts application automatically. Can someone
please suggest how to do it?

regards,
Pankaj

-
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: [shale] All SHail hale

2006-05-18 Thread David Durham

Craig McClanahan wrote:

On 5/18/06, Hey Nony Moose <[EMAIL PROTECTED]> wrote:



ahem ...




Can you guys please take it outside (i.e. offlist) and settle this among
yourselves.  Please?

Nobody else is interested.


You're probably right.  At any right, I think Dakota is actually Michael 
McGrady.  So, if you intend to follow his path through the archives, 
that might help.



Craig


Dave

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



Re: how to prevent to access folders in our application

2006-05-18 Thread David Durham

Patil, Sheetal wrote:

if I write in browser like http://indc-idc:1500/application/pages/  it
give list of all the files in folder "pages"


This is a Tomcat question, but if you look in the web.xml located at 
$CATALINA_HOME/conf/web.xml, you'll see something like this:



default
org.apache.catalina.servlets.DefaultServlet

debug
0


listings
true

1



For the listings param, you should set it to false.


-Dave

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



Re: using modules with JSPs behind WEB-INF

2006-05-16 Thread David Durham

Berk, Jason R. wrote:

I'm using struts 1.2.9 which the struts site claims is the "prime time"
ready version.

I would like to use modules and put my JSPs behind WEB-INF to protect
them.  When I try this with struts, it rewrites my URL with the module
name and causes 404 errors on validation failures.

I read all over the net that I need to change my forwardPattern &
pagePattern in my controller to "/WEB-INF/$M$P", but again, the struts
site docs explicitly state that anything other then $$, $M and $P are
"silently swallowed".

Been trying to get this to work for almost two weeks now.  Any help
appreciated.


The thing is that The Browser can not request /WEB-INF/..., but a 
RequestDispatcher will happily "forward" to /WEB-INF/...


Does this answer your question?

-Dave

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



Re: Forwarding or redirecting from a BaseAction

2006-05-16 Thread David Durham

Philihp Busby wrote:

One approach would be to extend the Struts ActionServlet controller.

I suggested this technique for auditing last week
.
You'd probably want to override processRoles instead, which happens
right after Struts resolves the URL path to an Action, but before the
ActionForm is created, populated, and validated. No sense validating a
user's input if you know he/she won't be granted access.


I've overridden the RequestProcessor.processPreProcess() to do this sort 
of thing.  RequestProcessor.processPreProcess() occurs before 
processMapping, so there isn't an ActionMapping yet.  You can still do 
URL based security mappings, or if you really want to get the Action 
class, you could do so from processPreprocess via processPath and 
processMapping, albeit in a redundant and sloppy fashion.


I think a filters based approach with something like Acegi is a good 
solution to this problem.



-Dave

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



Re: two forms on the same page?

2006-05-16 Thread David Durham

Franklin Phan wrote:

Is it possible to do this in Struts 1.1?  Two form beans on the same page?  How 
would the action mapping work?


Unless you're using wildcard mappings, you'll likely need 1 
ActionMapping per HTML form.



-Dave

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



Re: Class diagrams in an Struts application

2006-05-16 Thread David Durham

Vaneet Sharma wrote:

Hii Frnds

I ahve developed a application using Struts and EJB, 
Now i need to create class daigrams of my projrect.


Can somebody clear some doubts 

 In  class diagrams do we incl;ude action classes, form beans classes 
,helper classes, (EJB classes) ?


Whenever you create documentation, diagrams or otherwise, it's up to you 
or your organization or team or whathaveyou to determine the level of 
detail required.



-Dave

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



Re: Declarative Excpetion Handling

2006-05-16 Thread David Durham

Asad Habib wrote:
Has anyone successfully used declarative exception handling with Struts? 
For some reason, my application always forwards to the input attribute 
of the action element instead of the path element of the exception 
element as defined in my struts configuration file. I have confirmed 
that the error is being generated by the validateRequired method of the 
Struts Validator by using  to flush the errors on the page 
that I am forwarded to (login.jsp in this case). However, I am never 
forwarded to 'loginError.jsp'. Below is my 'struts-config.xml'. Any help 
would be appreciated. Thanks.


I think what's happening here is that the Exception is being thrown 
before the action is executed, i.e., during the validateRequired method 
of DynaValidatorForm as you say.


Think the exception element that you've indicated applies only to 
exceptions thrown from Action.execute.  The validateRequired method 
occurs earlier in the request processing than does Action.execute.  If 
your curious, you can look at ActionServlet and RequestProcessor source 
for more info.



-Dave



- Asad



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

  
  
  
   

   
  input="/login.jsp" validate="true">
  type="org.apache.struts.util.ModuleException" />

  
   

   

   
 value="/WEB-INF/validator-rules.xml, /WEB-INF/validator.xml" />

   


-
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: UML diagrams of Struts

2006-05-12 Thread David Durham

Vaneet Sharma wrote:

How can I get UML diagrams of Struts (specialy the class model diagram) ?
I have also  used EJB  in my application.


Most UML tools have the ability to import classes (or source) and 
generate diagrams.



-Dave

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



Re: [OT] - JSTL Parameter Conventions

2006-05-11 Thread David Durham

Kalcevich, Daniel wrote:

Dang, I must have been spacing when I was looking on the Jakarta Site
earlier.  Thanks Dave.


I wasn't sure if that's what you needed or not.  Good to hear that it is.

-Dave

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



Re: [OT] - JSTL Parameter Conventions

2006-05-11 Thread David Durham

Kalcevich, Daniel wrote:

Everyone,

Does anyone know of a tool or library that can be used to perform
similar operations as JSTL does with arguments like ${object.method}?  I
need to build a String that has to have arguments replaced on the fly
and thought if I could find something like how JSTL does it, that it
would work for me.  Thanks in advance.


Commons-EL, right?

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


-Dave

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



Re: troubles using java 5

2006-04-25 Thread David Durham

Dave Newton wrote:

[javac] error: error reading C:\projets\M_LIB\.classpath; error in
opening zip file


Sounds like either your build file is wrong or one of your libraries is
corrupted?


Maybe post the relevant section of your build file.


-Dave


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



LazyValidatorForm FormFile instantiation exception

2006-03-21 Thread David Durham

Hi,

I've got a form-bean definition like so:


 
 ...


When I load the page the first time, I get an instantiation exception:

   java.lang.InstantiationException: org.apache.struts.upload.FormFile

It doesn't seriously affect the application, but I'm curious about the 
solution to this problem.  I searched the [EMAIL PROTECTED] archives but 
didn't find this issue referenced.  Is there some way to set an inital 
value to null?  Maybe that would solve the problem?


Thanks,

Dave


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



Re: Struts in Action book

2006-02-02 Thread David Durham

Frank W. Zammetti wrote:

Generally-speaking, anything in the "X in Action" series, or the "X: The
Definitive Guide/Reference" from O'Reilly are worth your time, in my
experience.  I've yet to be disappointed by a book in either series.


I haven't been dissappointed by X in action, either.  I've got 
Hibernate, Struts, and Spring in Action.  There's a relatively new book, 
AJAX in Action (http://tinyurl.com/atuao), but I haven't read it. 
Reviews look good.



-Dave

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



Re: Stress Load AJAX web application

2006-02-02 Thread David Durham

Stas Ostapenko wrote:

Hi !

I have a Struts based web application where we using a lot of AJAX
things. I want to test application under load - for example 100
concurrent users. Standard tools is not acceptable, so I need some
kind of http client with XmlHttpRequest object supported. I know that
there is HttpUnit, but I'm not sure about AJAX support.
How it's can be done ?


Well, what part of the system are you testing?  If you're testing the 
server, then http requests are all you need.  The fact that XML is 
returned doesn't really have anything to do with testing the server.


Otherwise, maybe jsunit is of use to you:

   http://sourceforge.net/projects/jsunit/


-Dave

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



Re: Struts in Action book

2006-02-02 Thread David Durham
I highly recommend this book for anyone.  


Yeah, the book has good info, even if it is a bit dated (published in 
2002).  Or is there a new edition out that I don't know of?



-Dave


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



Re: Unsupported major.minor version 49.0

2006-02-02 Thread David Durham

Laurie Harper wrote:
Right, because by default a 1.4 compiler will target a 1.4 runtime. If 
you then try to run it on 1.3 you'll have problems unless you override 
the runtime target when using the 1.4 compiler.


And this is typically done by specifying "-target" and optionally 
"-source" arguments when invoking the javac program.



-Dave

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



Re: How to accress property set to action element

2005-12-06 Thread David Durham

nitin mandolkar wrote:

I want to access property that i set in action element.

Here is the action element in strust-config file.

   
 
   

^


   
   
   
 

How can i access 'authenticated' property element autheticated in
action call process() method. Is there any method in ActionMapping
class that will help to get this property.

Observation:
--
After setting this property i tryed to run my webapplication. But
which gives me an error.


That's not really much of an observation.  Maybe you have a typo?


-Dave

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



Re: [OT] AJAX (XMLHTTP) doesn't work with Ampersand

2005-09-06 Thread David Durham

Richard Yee wrote:

You should be using URLEncoding.encode() to encode the
response. This will replace ampersands with %26. The
only problem is that the space character is also
converted to a '+'. You then need to replace '+' with
%20 on the server after using URLEncoder.encode() so
that the JavaScript can decode it correctly.


The Javascript 'escape()' function may be useful here, but it sounds 
like you're doing the escaping on the server side.



- Dave

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



Re: [tiles] Empty attributes and Tomcat 5.5

2005-08-31 Thread David Durham

Wendy Smoak wrote:
I dropped a (Servlet 2.3) Struts 1.2.7 + Tiles webapp into a fresh 
Tomcat 5.5 install, and started seeing directory listings of contents 
under WEB-INF.


Tomcat properly refuses to serve any of the files; clicking on any of 
them gives the usual 404 that you'd get if you constructed a URL to 
something under WEB-INF.


It seems to be coming from tags like this

basicLayout.jsp:
  

when I do this to keep anything from appearing in that spot

tiles-defs.xml:
 

 

I don't know whether Tiles or Tomcat is at fault here, but I'm pretty 
sure that no matter how badly I misconfigure a webapp, [and I didn't 
change anything from what worked on Tomcat 4.1,] it should not be 
possible to get directory listings under WEB-INF.


(On advice from tomcat-user, I've "fixed" the problem by turning off 
directory listings for the default servlet in conf/web.xml.)


Has anyone else tried to move a Struts+Tiles app to Tomcat 5.5 with no 
changes?


I had a problem like this, but it was slightly different.  I had a very 
generic wildcard mapping, "/*", that forwarded to {1},  If there was an 
{1} forward configured, then it worked, otherwise, it would do 1 of 2 
things consistently: upchuck or print a directory listing.


Are you using wildcard mappings?


- Dave



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



Re: [Friday] [somewhat-ajax-related] XMLHttpRequest scoping problems

2005-08-23 Thread David Durham

Sudhaker Raj wrote:

You may want to check OpenRICO - http://openrico.org


Good link.  Much appreciated.


- Dave

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



Re: [Friday] [somewhat-ajax-related] XMLHttpRequest scoping problems

2005-08-22 Thread David Durham

Jeff Beal wrote:

  req.onreadystatechange = function() { processResponse(req); }


yeah, I think this is what I was looking for.  Thanks.


- Dave

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



[Friday] [somewhat-ajax-related] XMLHttpRequest scoping problems

2005-08-19 Thread David Durham

Hi --

There's been some traffic on this list involving XMLHttpRequests and 
javascript, and since it's Friday ...


My problem: How to use multiple asynchronous requests simultaneously 
without using the global namespace.  For instance, I'd like to create a 
little DirectoryTree widget that I can drop in pages like so:



new DirectoryTree("some_directory_name");
 

Ideally, I could drop as many of these widgets on the page as I want.

Then I have some javascript like so:

DirectoryTree = function(directory, url) {
//setup
...
execute(url, DefaultCallback);
}

Here's an execute method that supposed to trigger some kind of action:

execute(url, callback) {
var cb = new callback();
cb.request = new XMLHttpRequest();
cb.request.onreadystatechange = callback.processResponse;
cb.request.open(this.METHOD, url, this.ASYNC);
cb.request.send(null);
}

DefaultCallback = function() {
this.request = null;

function processResponse() {
log.info("decorating: " + this.request);
}
}


The processResponse() method alerts:  "decorating: undefined".  I even 
tried:


DefaultCallback = function() {
this.request = null;
}

DefaultCallback.processResponse = function() {
log.info("decorating: " + this.request);
}

and got the same result.

I'm somewhat experienced with Javascript and it's OO concepts and event 
handling, but not terribly so.  I think what's happening here is that on 
readystate change triggers the creation of a new 
'DefaultCallback.processResponse' object and therefore a new scope with 
no concept of the 'var cb = new callback()' scope.  Therefore, in order 
to get at the xmlrequest/response, I need to go through the global 
namespace or some other static-like namespace, which I don't really want 
to do because I'd like to avoid managing, say a queue of xml http 
requests.  I haven't looked through the xml http request stuff that was 
posted to struts sandbox (I think it's in sandbox, not really sure), but 
does anyone have ideas on this one, or can point me to some code or info 
with solution(s)?



- Dave

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



Re: [OT]: Struts and Hibernate lazy

2005-08-10 Thread David Durham

Konrad Billewicz wrote:

Lindholm, Greg  neom.com> writes:
 


What I do is use a Hibernate Servlet Filter that closes the Hibernate
session 
at the end of the request.  This is used in conjunction with the

HibernateUtils
class that stores the Hibernate session in ThreadLocal storage.

An example of this technique is on the Hibernate site
(http://www.hibernate.org/43.html)



This is exactly what I need. Thank you very kindly.


You might not want to do this across the board for you whole app because 
it puts a lock on a (presumably pooled) database connection for the 
entirety of the response.  You may not have a problem, but that depends 
on your performance requirements.



- Dave

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



Re: [OT] Re: I am need the solution too...

2005-08-03 Thread David Durham

[EMAIL PROTECTED] wrote:

Readingyourmind...now.

*sigh*

I was unsuccesful.


How ... to ... use ... onclick ... event ... to ... submit ... form ...

Click me to submit form and populate a DynaActionForm



- Dave

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



Re: Loading properties

2005-08-03 Thread David Durham

[EMAIL PROTECTED] wrote:

Hi!

I would like my web-app to read in a *.properties file at startup (not for
i18n, but the good old
java.util.Properties, for example to get the e-mail address of the admin of
the web-app). So
I wrote a ServletContextListener which will load the properties-file and
store it into servlet
context from where it can be accessed throughout my web-app. But where I do
have to
put the myProps.properties file? I tried WEB-INF/classes, but I get a
FileNotFoundException.
Or do I have to configure web.xml or struts-config.xml in some way? Or is
there a better
way to store the required data (such as admin's e-mail)?



You can put context parameters in web.xml:


PARAMETER_X
xxx


//You then access it by:
servletContext.getInitParameter("PARAMETER_X");

http://forum.java.sun.com/thread.jspa?threadID=498993&messageID=2364171


If you need to access the properties outside of the "web layer", i.e. 
you don't have a reference to the request object because you're in some 
other layer of the app, then you can use some kind of properties 
manager.  Here's a related thread:


http://marc.theaimsgroup.com/?l=struts-user&m=111808953102759&w=2

Another way to do this is to use JNDI.


- Dave



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



Re: Problem with Dyna Form

2005-07-28 Thread David Durham

Kade Jeevan Kumar wrote:

Hi All,
 
My requirement is to generate a set of dynamic rows(with checkbox and combo box) at client side using JSP and Struts 1.1.

As of now, i am generating the above stuff using java script.
How can i use Dyna Form to meet the above requirement (or) suggest me other way 
if u have any solution for this.



You can you use a dyna action form with a property like this:




- Dave

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



Re: Moving from environment to environment

2004-09-10 Thread David Durham
Dave Bender wrote:
How do you easily move a Struts application from one environment to 
another,
e.g. from development to test to production, without having to change the
struts-config.xml file to use a different database?
If you're using ant, then you could maintain 2 seperate struts-configs 
and  the production config (e.g., struts-confg-production.xml), 
into you deployment directory as struts-config.xml.  This would require 
that you maintain 2 copies of struts-config.xml: 
struts-config-development.xml and struts-config-production.xml, for example.

Another option is to use filters along with ant's copy task:
   http://ant.apache.org/manual/CoreTasks/copy.html
I personally maintain 2 properties files: application.properties and 
application-production.properties and use the method of replacing files 
in a deployment directory.  My struts-config, however does not change.  
That's just how my project is setup.

The datasources seem like they can be configured only in that file, but if
you want to have different database configs in the different environments,
it seems like you have to edit that file. Am I missing something? Is there
a way around that?
I think JNDI is useful this kind of problem as well, but I don't have 
much experience with it.

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


[OT] Re: Single sign-on

2004-09-09 Thread David Durham
Seaman, Sloan wrote:
We use JNDI to hit our MS Active Directory server.
MS Active Directory is for weenies.  Are you browsing with Internet 
Explorer too?

Works rather well :)
Until you get fined by the worm police.
BTW, this e-mail was typed from an XP workstation.  Not *my* 
workstation, mind you.

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


Re: [OT] Setting up a struts project in IDEA

2004-09-09 Thread David Durham
Rick Reumann wrote:
David Durham wrote:
Now you're forced into choosing from their "modules."
You can basically almost always just choose the "java module" and then
do as you say add what you need.. very easy. So you aren't really
'forced' into anything and can always do things like you were used to.
The advantage of some of the other modules is that it does some adding
for you... for example, if you choose web module it'll look in
WEB-INF/lib and add those jars automatically. Stuff like that.
Web support used to be a checkbox.  No doubt they've added features and 
perhaps the new project module mentality is easier to understand.  I 
think I'm just venting my initial frustration with the tool and maybe I 
just need to get used to it.  After all, it was a major version number 
change.

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


Re: is strut a good choice in my case.

2004-09-08 Thread David Durham
Bill Siggelkow wrote:
Brain spouts sludge
Mouth obeys brain
White coats come.
I was going to post something about stress testing ...
- Dave
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts XDoclet examples

2004-09-08 Thread David Durham
I should probably post this stuff on XDoclet's list ...
David Durham wrote:
That's good information; I read it with vigor...  As you can tell, I'm 
excited by the prospects of using XDoclet instead of .

And, I think I get the gist of Struts related support provided in 
XDoclet, but I have a couple of questions.  1 -- How good is the 
DynaValidatorForm support?  I saw the announcement: 
http://www.systemmobile.com/code/xdoclet-dynaform-README.txt.  That 
looks well and good, but there appear to be some discrepancies:

Class Level Tags:
@struts.dynaform
Attributes:
name- The name of the form bean in the config. [required]
type- The type of DynaForm. [required]
description - Descriptive string. [optional]
className   - The config class. [optional]
validate- If set, the validator code will generate a form definition
 for this dynaform.  [optional]
Method Level Tags:
@struts.dynaform-field
Attributes:
name  - The name of the form field.  If not specified, the property name
   of the method is used. [optional]
 

What method?  I thought this was a dynaform?
type  - The type of field.  If not specified, the return type of the
   getter is used. [optional]
 

Again, we're talking about dynaforms...
I'm going to put these XDoclet tags in an Action, I presume.  Is there support for 
DispatchActions?
I'm just starting to dig into this tool.  I may end up adding some code of my own to 
these projects, just so I don't sound like a whiner.
Thanks, 

Dave
-
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 XDoclet examples

2004-09-08 Thread David Durham
That's good information; I read it with vigor...  As you can tell, I'm 
excited by the prospects of using XDoclet instead of .

And, I think I get the gist of Struts related support provided in 
XDoclet, but I have a couple of questions.  1 -- How good is the 
DynaValidatorForm support?  I saw the announcement: 
http://www.systemmobile.com/code/xdoclet-dynaform-README.txt.  That 
looks well and good, but there appear to be some discrepancies:

Class Level Tags:
@struts.dynaform
Attributes:
name- The name of the form bean in the config. [required]
type- The type of DynaForm. [required]
description - Descriptive string. [optional]
className   - The config class. [optional]
validate- If set, the validator code will generate a form definition
 for this dynaform.  [optional]
Method Level Tags:
@struts.dynaform-field
Attributes:
name  - The name of the form field.  If not specified, the property name
   of the method is used. [optional]
 

What method?  I thought this was a dynaform?
type  - The type of field.  If not specified, the return type of the
   getter is used. [optional]
 

Again, we're talking about dynaforms...
I'm going to put these XDoclet tags in an Action, I presume.  Is there support for 
DispatchActions?
I'm just starting to dig into this tool.  I may end up adding some code of my own to 
these projects, just so I don't sound like a whiner.
Thanks, 

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


Struts XDoclet examples

2004-09-07 Thread David Durham
Is there a good site/spot for Struts XDoclet examples.
I'm using:
   http://xdoclet.sourceforge.net/xdoclet/tags/apache-tags.html
But, I'm also looking for some examples.
Thanks,
Dave

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


Re: Hibernate VS ibatis, which is better?

2004-09-07 Thread David Durham
Ted Husted wrote:
On Thu, 02 Sep 2004 10:33:44 -0500, David Durham wrote:
 Way to shut down a perfectly good thread, Ted.  -)  BTW, I read
 your book.  When's the book covering 2.0 due?
2.0 of what? :)
Yeah, I guess it's too early to say. 

Someone could come along with a very comprehensive (1000 pages in small 
font ought to do it) book on Struts, the different Tag libs, and 
different Modeling frameworks.  I think It would be a boon to a lot of 
people.

An early release is available at the iBATIS.NET site. 
<http://sourceforge.net/project/showfiles.php?group_id=109704>
A co-worker of mine is getting started on a .NET app.  I'll pass this along.
Thanks.
- Dave
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Setting up a struts project in IDEA

2004-09-03 Thread David Durham
Denis Avdic wrote:
Is there anyone out there using IDEA 4.5 that has a list of settings,
paths and other things that need to be set in order for all the bells
and whistles to work?
I've got it installed and I can't stand what they did with Projects.  
With 3.0, it was easy to add a project and add libraries and classes to 
your classpath.  The web-app support was pretty good.  Now you're forced 
into choosing from their "modules."  The whole stinks like shit, if you 
ask me.  Maybe I'm missing something, though.  I'll be following this 
thread -- assuming it goes somewhere.

--
Dave

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


Re: forwarding to an action w/o an input JSP

2004-09-02 Thread David Durham
Chuck Chopp wrote:
I'm looking for some good solid examples that show how to configure 
the JSP
files, struts-config.xml [global forwards, action mappings, form 
beans] and
action classes where a JSP may forward/redirect to an action [may end up
being a chain of actions] 
Dear God, please let no one help him with this.  Are you talking about 
request dispatching from a JSP to an Action?  That's not a chain of 
Actions.  Thats, well, I don't think there's a name for it -- not a good 
one, anyway.

before another JSP is finally displayed. The 2
books that I've been using for learning Struts are "The Struts 
Framework: A
Practical Guide for Java Programmers" by Sue Spielman and "Programming
Jakarta Struts" by Chuck Cavaness. 
I don't know about the first book, but the second is very well written, 
IMHO.

Both of these books seem to be lacking
solid explanations & examples of the the full range of configurations for
forwards & actions. 
Again, I have to humbly disagree with you on this point.
I keep getting the feeling that if I could see one good
comprehensive working example everything would be clear to me about 
how this
is supposed to work.
There's plenty of them out there.  Struts itself ships with one.
I have a welcome file named "index.jsp". I'm questioning if it should be
forwarding to the JSP file "login.jsp" [which I want to protect from 
direct
access from the browser] or should it be forwarding to the action named
"login" [or would it be "login.do"]? 
If you're going to protect a JSP from direct access, one good way is to 
put the JSP inside the WEB-INF and then have an action do a forward to 
that JSP (presumably after a security check).

The action named "login" expects to
use "login.jsp" as its input, and I'm just not certain now whether
forwarding to a JSP will invoke the action or if forwarding to the action
will cause its input form to be displayed.
The request itself cause an action to be invoked.  That is, a request 
comes in that matches the URI mapping to the ActionServlet.  Hopes 
that's clear (it's crucial.)  The ActionServlet receives the request and 
does something with it (probably calls an Action, passing it the 
request).  Then you're action does some stuff and returns a Forward.  
The ActionServlet then calls a RequestDispatcher's forward method based 
on the Forward that was returned to it.  Basically, your Action returns 
a forward to a JSP (better off not to chain actions), and the JSP writes 
to the response.


Also, in my web.xml file, I have a url-pattern of "*.do" set in my
servlet-mapping. 
This is so that requests matching *.do get passed to the ActionServlet.  
The ActionServlet looks at the * part to pass off to the correct action.

What I'm not clear on is how/why URLs appear back in the
browser such as "login.do" and "success.do" when the global forwards 
that my
actions are using are called by their configured names of "login" and
"success".
I think you're confusing a "forward" with a redirect.  A forward, in 
this context refers to an internal process in you ServletContainer.  
Namely, a RequestDispatcher is used to pass the request off between 
Servlets.  In this case, we're passing the request off (internally) from 
the model (ActionServlet and Action) to the view(a JSP).  Your URL will 
still be reflective of the original request (something.do), because a 
redirect wasn't returned to your client -- the directing was handled 
internally.  This is a major strength of Struts.

I'm concerned about the browser backward/forward buttons and the
reload button being clicked & what this might do to navigation within 
my webapp.
I don't have too much for you on this.  I'm almost positive that there 
are hooks to check for "duplicate" requests occurring within a timeframe 
(not nessecarily part of struts), and the backward/forward button issue 
has to do with the statelessness (did I type that right?) of HTTP.  That 
is, you have to be ready for any kind of request with security and 
validation in mind.  Struts is not going to do that for you, but it 
contains certain extension points, including plugins, that make it easy 
to consolidate this code.

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


Re: Hibernate VS ibatis, which is better?

2004-09-02 Thread David Durham
Way to shut down a perfectly good thread, Ted.  ;-)  BTW, I read your 
book.  When's the book covering 2.0 due?

Ted Husted wrote:
On Thu, 02 Sep 2004 10:45:03 +1200, struts Dude wrote:
 

Seeing so many support for either side,
I might as well flip a coin to decide
whether or not to learn hibernate.
   

As a technologies, both are easy-to-use and powerful. The difference is that they use different paradigms. 

As it stands today, a team has three major choices in data access libraries:
1. Roll your own persistence layer using the stock data access libraries (JDBC) 

2. Use an Object-Relational-Modeling (ORM) Tool, like Hibernate or Apache OJB or Sun's 
JDO
3. Use a Data Mapper framework, like iBATIS
Rolling your own with the stock libraries are a good choice for small applications 
with stable requirements. (If you're lucky enough to have one of those!)
ORM tools (like Hibernate) are a good choice when:
1. Have complete control over your database implementation
2. Do not have a Database Adminisrator or SQL guru on the team
3. Want to model the problem domain outside the database as an object graph
A Data Mapper (like iBATIS) is a good choice when:
1. You do not have complete control over the database implementation, or want to 
continue to access a legacy database as it is being refactored
2. You have database administrators or SQL gurus on the team
3. The database is already being used to model the problem domain, and the 
application's primary role is help the client use the existing database model.
In practice, it has less to do with iBATIS or Hibernate, and more to do with what 
you're hooking up with :)
HTH, Ted. 


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


  1   2   >