Problem with JDBC & Struts Connection Pool (possible to reconnect?)

2003-01-17 Thread mech
Hi,

I'm running Tomcat 4.1.18 on Solaris 9 with a local MySQL 3.23.54-max
(InnoDB) database on port 3307 using started with mysqld (not
safemysld...difference btw?).

After not using any connection over night for let's say 12 hours or
more, I get SQLExceptions next morning:

"java.sql.SQLException: Communication link failure:
java.net.SocketException"

In my application I use JDBC for Tomcats security realm feature and
form-based auth. When I try to login for the first time, I get this
error log (see below), but if I try to login twice the db connection
seems to get reset automatically. (A solution I could live with,
although I have now idea why the connection was cut while it should be
idle overnight)

Unfortunatelly my struts connection pool that I use in my application's
data access classes doesn't get reinitialized after such a
SocketException (see below). The only solution so far was to reload or
stop/start the webapp with the Tomcat manager. Bad solution

In my struts-config.xml I already have something to reconnect (see
below), but it obviously didn't do the trick with my
"mysql-connector-java-2.0.14.jar" J/Connector. I simply lost the
connection somehow...

Can anyone give my an hint what happens to my MySQL connections? I don't
seem to have a problem if I send a query from time to time, but if I
wait too long and do nothing, I'm cut off... :-(

In case there's no way to stop this, is there a solution how to tell my
application (a java code snippet would be great...) to reinitialize the
Struts connection pool when this exception is thrown. For Tomcat's
JDBCRealm it is done somehow, how can I reset the MySQL connection for
Struts? I think I could live with a reconnect on the second try for a
query.

Thanks you!
Michael



--













  



EXCEPTION from log file:

(first time to try a login and utilize the connection again after long
idle time)
2003-01-17 12:28:55 JDBCRealm[/praksis]: Exception performing
authentication
java.sql.SQLException: Communication link failure:
java.net.SocketException
at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.PreparedStatement.executeQuery(Unknown Source)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:480)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
5)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:43
2)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces

PJA libraries

2003-01-17 Thread Yakov Belov
Dear All,

this might be the wrong mailing-list to send this question to, however maybe not.

I am using PJA (pure java graphics implementation) libraries for my chart drawing with 
Struts on Tomcat.

To use these libraries I need to change the system a bit, like this:

System.setProperty ("awt.toolkit", "com.eteks.awt.PJAToolkit");
System.setProperty ("java.awt.graphicsenv", "com.eteks.java2d.PJAGraphicsEnvironment");
System.setProperty ("java.awt.fonts", "/usr/share/fonts/default/TrueType");

and I place all the jar files under WEB-INF/lib for the application. However when I 
try to draw an image, I receive:

java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment

where com.eteks.java2d.PJAGraphicsEnvironment is a class in one of the jar files. What 
might be the problem?

Thanks in advance,
Yakov

P.S. I should try Tomcat mailing list as well.



Re: changing ActionForm to be a Java interface

2003-01-17 Thread Dan Jacobs
Hi Mark,

Contravariance is generally easiest to understand in the context of 
aggregation.  Consider the parameterized types (looking ahead to Java 
generics) List and List, and variables fruitList and 
bananaList, and assuming that Banana is a subtype of Fruit.  Even though 
it should be ok in a polymorphic language to assign a value of [static] 
type Banana to a variable with a type of Fruit, it should be legal to 
assign a List to the variable fruitList.  If you did, then 
static typing would indicate that you could add an Apple to that list, 
and that would be wrong!  It has to do with *static* (i.e. compile-time) 
typing, which is the kind of typing that makes most Java programs easy 
to understand.

There are some excellent papers by Luca Cardelli that deal with this in 
a much more rigorous manner, but they're not fun to read to your friends 
at parties :-).

In the context of this thread, contravariance is the mathmatical 
relation between types that exposes the dark side of inheritance.  This 
usually shows up when an "is-a-part-of" relationship is implemented as 
an "is-a-kind-of" relationship.  This results in a subclass that has 
operations that don't make sense for the superclass, or are just 
contradictory when applied to the superclass.  That's what I'm claiming 
is the problem with the current implement of form-beans.

-- Dan

Mark Galbreath wrote:

Okay, I'll bite.  What is "contravariance?"

Mark

-Original Message-
From: Dan Jacobs [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 7:17 AM

Based on the oft misunderstood property of contravariance, I *do* 
conclude that form-beans should not be subtyped from Java Beans, for the 
reason that subtypes are never supposed to have fewer behaviors than 
their supertypes.  It's customary in good object-oriented design to use 
delegation rather than subclassing to use only a selected subset of 
behaviors from another kind of thing.  If Struts is saying that a 
form-bean should never act like a bean in such-and-such manners, then it 
follows that form-beans should not be beans.  This *is* an architecture 
issue.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: AW: Refresh on MSIE, PLEASE HELP!! NOT SOLVED

2003-01-17 Thread Karim Saloojee
Hi

I know that in IE you sometimes have to set the response headers in Java,
e.g:

<%
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control", "no-cache");
%>

Put that in skel.jsp.

One last thing, make sure you have cleared out your IE cache before
re-testing (Tools > Internet Options > Delete Files > Delete All Offline
Content > Ok).

Good Luck,
Karim

- Original Message -
From: "kiuma" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 3:00 PM
Subject: Re: AW: Refresh on MSIE, PLEASE HELP!! NOT SOLVED


> Hirschmann, Bernhard ha scritto:
>
> >>Sadly this doesn't solve the problem!
> >>
> >>
> >
> >Does your browser use a http proxy? Maybe this is the reason.
> >
> >Bernhard
> >
> >--
> >To unsubscribe, e-mail:

> >For additional commands, e-mail:

> >
> >.
> >
> >
> >
> No proxy set.
> The fact is that with Mozilla works but not with MSIE.
> I'm using tiles  and I see this strange bheav.
>
> I'm using tiles
>
> so I have
>
> <%@ taglib uri="/WEB-INF/struts-tiles.tld"
> prefix="tiles" %>
> <%@ taglib uri="/WEB-INF/struts-bean-el.tld"
> prefix="bean-el" %>
>
> 
> 
> 
> 
>  content='/secure/activitycenteredit_center.jsp'/>
> 
>
>
> I write the server current time in '/secure/menu.jsp' and
> '/secure/activitycenteredit_center.jsp' which contains the form.
>
> but, while in men the time is update when i access the page,
> /secure/activitycenteredit_center.jsp continue to hold old values.
>
>
> in skel.jsp'   header I've put
>
> 
> 
> 
>
>
> The problem is only with MSIE!!
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Display values after validation (was RE: action input)

2003-01-17 Thread Susan Bradeen
But by using an action path for input instead of a JSP, isn't the 
ActionForm reset, so you no longer have your form values to show in the 
JSP again? How do you redisplay the incorrect values the user typed into 
the JSP? 

Susan Bradeen

On 01/16/2003 03:22:14 PM "Mark Galbreath" wrote:

> Try it and see.
> 
> input is the application-relative path to the input form to which 
control
> should be returned if a validation error is encountered and you have to
> specify the name attribute of the form bean associated with the action.
> 
> Mark
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: action input
> 
> 
>  input="mypage.jsp">
> 
> 
> 
> Can I set input="myAction2.do"?
> 
> 
> 
> Regards,
> 
> 
> 
> 
> 
> 
> 
> PQ
> 
> 
> 
> "This Guy Thinks He Knows Everything"
> 
> "This Guy Thinks He Knows What He Is Doing"
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail: 

> For additional commands, e-mail: 

> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: (Another test) App Modules and multiple tiles configuration files...

2003-01-17 Thread Cedric Dumoulin


 According to the log, both factories are loaded. So, there should be 
something wrong. Can you send me directly ([EMAIL PROTECTED]) your 
simple example (zip or war), so I can reproduce the problem ?

  thanks,
Cedric

ajTreece wrote:

Thanks Cedric...

I'm using 01/16 nightly build. My web server is Tomcat v4.1.18.  Here 
is the output when I re-deploy the webapp:

[INFO] TilesRequestProcessor - -Tiles definition factory found for 
request processor ''.
[INFO] TilesRequestProcessor - -Tiles definition factory found for 
request processor '/knowledge'.
[INFO] PropertyMessageResources - -Initializing, 
config='org.apache.struts.util.LocalStrings', returnNull=true
[INFO] PropertyMessageResources - -Initializing, 
config='org.apache.struts.action.ActionResources', returnNull=true
[INFO] PropertyMessageResources - -Initializing, 
config='MessageResources', returnNull=true
[INFO] TilesPlugin - -Tiles definition factory loaded for module ''.
[INFO] TilesPlugin - -Tiles definition factory loaded for module 
'/knowledge'.
[INFO] TilesRequestProcessor - -Tiles definition factory found for 
request processor ''.
[INFO] TilesRequestProcessor - -Tiles definition factory found for 
request processor '/knowledge'.
[INFO] PropertyMessageResources - -Initializing, 
config='org.apache.struts.util.LocalStrings', returnNull=true
[INFO] PropertyMessageResources - -Initializing, 
config='org.apache.struts.action.ActionResources', returnNull=true
[INFO] PropertyMessageResources - -Initializing, 
config='MessageResources', returnNull=true
[INFO] TilesPlugin - -Tiles definition factory loaded for module ''.
[INFO] TilesPlugin - -Tiles definition factory loaded for module 
'/knowledge'.

From my limited knowledge it looks like both Tiles definition 
factories are loaded. Yet, if I do not include the knowledge defs in 
the first factory load they are not seen correctly by the knowledge 
module.

I'm open for any suggestions.


Thanks, ajTreece



Cedric Dumoulin wrote:


 Which Struts version do you use ? Try with the latest nightly build 
or the 1.1b3.
 Also, the log of the struts servlet should report a message for each 
module factory loaded. Check it to see if all is right or not.

   Cedric

ajTreece wrote:

Thanks Cedric for replying...

Here is what is happening and I'm not convinced that it is how it 
should work

I have two modules A and B (for simplicity). They are defined in 
web.xml as follows:


  config
  /WEB-INF/config/struts-A-config.xml


  config/B
  /WEB-INF/config/struts-B-config.xml


I have (at this time) three tiles defs files... COMMON, A, and B. 
The COMMON defs handle the main page layout and other tiles common 
to all modules for this site. Tiles defs A and B are specific to 
that particular module. Here is how they are defined in each module 
xml file which is not working:

...struts-A-config.xml...

  
 value="/WEB-INF/config/tiles-COMMON-defs.xml,
/WEB-INF/config/tiles-A-defs.xml" />
  


...struts-B-config.xml...

  
 value="/WEB-INF/config/tiles-COMMON-defs.xml,
/WEB-INF/config/tiles-B-defs.xml" />
  



The only way I can get the tiles to display correctly is if I 
include B's tiles defs in the module A's plugin as follows:

 ...struts-A-config.xml...

  
 value="/WEB-INF/config/tiles-COMMON-defs.xml,
/WEB-INF/config/tiles-A-defs.xml,
/WEB-INF/config/tiles-B-defs.xml" />
  


Also note, that module B's plugin must still include both the COMMON 
and B's tiles defs to work. It is almost acting like ALL of the 
tiles defs need to be initialized via first plugin accessed via 
web.xml. Is there something wrong or is that the way it is suppose 
to work?

Thanks again, aj



Cedric Dumoulin wrote:



ajTreece wrote:


Folks Just for grins, I tried something different I 
basically have two struts-config.xml files (one for each module) 
and in each I call the plugin to load the tiles factory required. 
Just to see what would happen I included ALL of my 
tiles-*-defs.xml files in the definitions-config property  for 
each struts-*-config.xml and low and behold the desired tile 
layout displayed for each page.
 







Am I reading the books / docs incorrectly? I am assuming that each 
application module could have it's own unique and private tiles 
definitions files. What "seems" to be happening is that ALL of my 
tiles definitions need to be initialized via the plugin in the 
struts config file.





 Yes, each module have its own definitions file when 
moduleAware="true".
 Can you check the servlet logs to see if there is one or two 
factory loaded ?


Has anyone else had success using multiple application modules 
with individual tiles definitions?





  Yes, me ;-). The tiles-documentation.war use modules with 
different tiles config file.

   Cedric



Thanks aj



ajTreece wrote:


Afternoon folks.

Re: ActionErrors getting lost between action and JSP

2003-01-17 Thread Giri Alwar
When  you call the saveErrors(...) method in the Action class' execute
method, Struts will store the ActionErrors object under the default request
attribute name "org.apache.struts.action.ERROR". In the JSP, when you add
the empty html:errors tag: , Struts will look for this
attribute in the request and display the errors. There is generally no need
for you to save the errors under a different attribute name in the request
in your Action class or specify a "name" attribute in the html:errors tag.

You stated that you were saving the errors under the name "errors" in your
Action class but your earlier code snippet shows that you were just calling
saveErrors(...). Are you saving the errors yourself under a different
attribute name? If so, are you doing this in addition to or in place of
calling saveErrors()? It is not clear to me what your execute() method looks
like.

- Original Message -
From: "Parnell, Giles (AU - Sydney)" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 5:03 PM
Subject: RE: ActionErrors getting lost between action and JSP


> Hi there Giri
>
> I seem to have got this working... although not sure why it's doing what
it
> is. I've included my jsp.
> I basically traced though the SaveErrors method and saw that it appears to
> be changing the name of the actionErrors object on the request.
> - In my action i save it with the name : errors.
> - In the SaveMethod it seems to replace errors with:
> 'org.apache.struts.action.ERROR'
>
> So now in my jsp, i just use that name in the name portion of the html
tag,
> like so:
>
> 
>
> Do you have any idea why this is happening ?
>
> I am using struts1.0.2. Our company will not go to 1.1 as it's still beta.
> :(
>
>

> ***
> Heres my overall jsp:
>

> ***
> <%@ page language="java" import="java.lang.*, java.util.*" %>
>
> <%@ page import="org.apache.struts.action.Action" %>
> <%@ page import="org.apache.struts.action.ActionErrors" %>
>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> <%
> response.setHeader("Cache-Control", "no-cache");
> response.setHeader("Pragma", "no-cache");
> response.setDateHeader("Expires", 0);
> %>
>
>
> 
> 
> oops in gEm!
>  src="../../static/js/rollUp.js">
>  type="text/css">
> 
>
>  marginwidth="0" marginheight="0">
>
>  type="au.com.eclipsegroup.egem.valueObject.VOErrors"
> action="/roleTypeCheck.do">
>
> 
> 
>
>
>  cellpadding="0" align="center">
> 
> 
> If you have come to this page - a critial system error has occured.
> Unfortunately your current changes will be lost. Please take note of the
> error message(s), and then click on the above 'myCareer' tag to return to
> your home page 
> 
>
>  
>
> 
> 
>  name="org.apache.struts.action.ERROR"/>
> 
>
> 
>
>  
> Take
> heart in knowing the issue will be resolved !
> 
>
> 
> 
>
> 
> 
>
>

> ***
> Here's my struts-config portion
>

> ***
> 
> type="au.com.eclipsegroup.egem.actions.cde.cp.PreCreateCareerPlanAction"
>   scope="request"
>validate="true">
>   
>   
> 
>
>
> Any ideas why the object is getting renamed on the request ?
>
> Thanks Giri
> Giles
>
>
>
> -Original Message-
> From: Giri Alwar [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 17 January 2003 5:55 AM
> To: Struts Users Mailing List
> Subject: Re: ActionErrors getting lost between action and JSP
>
>
> See my comments below.
>
> - Original Message -
> From: "Parnell, Giles (AU - Sydney)" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 10:03 PM
> Subject: RE: ActionErrors getting lost between action and JSP
>
>
> > Hi there Giri
> >
> > Thanks for your reply. The thing is... these are all the options I have
> > tried.
> >
> > I've removed all the irrelevant code from my source for you to look at:
> > 
> > log.error("Add some errors to check this working !!!");
> >
> > errors.add("test1", new ActionError("errors.moreThanOneEmployee"));
> > errors.add("test2", new ActionError("errors.XMLHydration"));
> >
> >
> > log.debug("Wot is the size of the actionErrors: " + errors.size());
> > saveErrors(request, errors);
> >
> > return (mapping.findForward("failure"));
> >
>
> This part looks ok.
>
> > ...
> >
> > - As i said before... the logging statement shows two errors in the
> > actionErrors object.
> > - Tracing through the SaveErrors method the errors are still
there...
> > - It's on leaving the action, and entering into the html:errors tag that
> it
> > appears empty.
> >
>
> Can you post the JSP portion where you are trying to display the errors?
> Al

Re: Struts app design for multiple client types

2003-01-17 Thread Kris Schneider
Thanks for tip, I took a quick look. I have to say the first example 
made my head spin.

http://home.attbi.com/~danjacobs/jplates.com/examples/test/ClassInfo1.jplate

It just doesn't look like the kind of approach that would appeal to the 
no-scriptlet faithful (which is where I firmly plant myself). Of course, 
I didn't get much beyond the example, but I'm not too inclined to keep 
investigating at his point. The front page of the site sounds great 
though...

Dan Jacobs wrote:
Hi Kris,

Unless your application data starts off as XML in the first place, and 
assuming you're a Java programmer, I recommend using JPlates 
(http://www.jplates.com) for multi-target transformations.  JPlates is a 
fully object-oriented template language, and I've used it very 
sucessfully both for generating HTML and for transforming XML.

-- Dan

Kris Schneider wrote:

I'm in the process of designing a single web app to support two 
different client
types: HTML and VoiceXML. Yes, yes, I know, XSLT is just the ticket. 
That was my
initial take at least, but I'd like to bounce some things off the 
Struts hive
before committing to it. To add some context, I'll be deploying on a 
full J2EE
1.3 platform, so things like servlet filters and JSTL get to play. I'm 
also
aware of existing XML/XSLT solutions like Cocoon, stxx, and StrutsCX 
and have
done some preliminary investigation of each. The application itself is 
generally
form/data driven. The major issues I'm currently spinning on are the 
following:

What do the existing solutions offer that I couldn't do with JSTL and 
relatively
simple filters? For instance, my JSPs might just become:


 


How difficult would it be to duplicate the functionality of the Struts 
html and
nested tags? Those tags do a lot of work on a page author's behalf 
with respect
to handling form rendering, indexed form bean properties, transaction 
tokens,
URL encoding, etc. If the app is just dumping XML, then it seems like 
the XSLT
styleheets could get pretty hairy. I suppose the Struts tags could 
still be used
to output XHTML fragments which might make the transforms less painful.

If you've got some specific insight into those issues, or would just 
like to
share your approach to using Struts for apps that support multiple 
client types,
I'd love to hear about it. Thanks.





--
To unsubscribe, e-mail:   

For additional commands, e-mail: 


--
Kris Schneider 
D.O.Tech   


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread João Paulo Batistella
Please, where can I download the Microsoft Javascript
Debugging Tool to use with Internet Explorer?

Thanks,
Joao Paulo.

___
Busca Yahoo!
O melhor lugar para encontrar tudo o que você procura na Internet
http://br.busca.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




how to use ApplicationResources from the logic tag

2003-01-17 Thread Garth Ramakant Patil
hi,
i'm trying to use a value set in my ApplicationResources.properties file
to use in a logic:equal tag in my jsp. basically, i'm trying to store some
configuration parameters in the ApplicationResources.properties file, but
i can't figure out how to get them outside of bean:message. is there a
direct method for using a property in the logic tag?
thanks,
/gp


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: The best way for learning struts (stupid question)

2003-01-17 Thread Craig R. McClanahan
Snipping to just the questions.

On Thu, 16 Jan 2003, joni santoso wrote:

> >* Design patterns (at the programming level)
>
> any good sites for learning this? I read already the
> theoretical ones but at the programming level, sometimes
> I'm still confused to use which DP.
>

The classic text (and the one that really popularized the notion of caring
about the "design patterns" concept) is by four authors colloquially known
as the "Gang of Four" (or GoF):

  Gamma, Helms, Johnson, Vlissides, DESIGN PATTERNS:  ELEMENTS
OF REUSABLE OBJECT-ORIENTED SOFTWARE, Addison-Wesley, 1995.

Punch "design patterns" into Google or Amazon and you'll find lots of info
sources, including many focused on Java or J2EE (servlet/JSP are the
standard web tier technologies for J2EE).

On "when to use which patterns", it's a skill that comes from practice and
experience.  However, I'd start by seeing if your problem space is similar
to things in the "Applicability" section of many pattern descriptions.
And check the "Consequence" (both good and bad) to see if applying this
pattern would help you towards better results.

> >
> >* Unit testing concepts and test-first design (JUnit is a
> >wonderful
> >   tool for this in the Java space)
>
> I learned this too. But, it seems that there're a few
> tutorial on JUnit. Can anyone here refer me?
>

There's some philosophical and introductory stuff on the JUnit web site
(www.junit.org).  But JUnit is primarily a tool to implement a philosophy
-- the philosophy of "unit testing" as a discipline.  You might want to
search for that term to get some references.

One thing you might want to do is download the source code to a small bit
of code that is heavily unit tested (such as commons-beanutils that Struts
uses), and see what we did -- the intent was to write tests for every
possible invocation of every possible method.  Having the tests in place
does two primary things for us:
* Documented proof that the method being tested behaves
  according to it's (Javadoc) specification
* Protection from future developers making changes and
  inadvertently changing the behavior that users of the
  code depend on.

You can grab a source distro of commons-beanutils (pick any recent nightly
build) at:

  http://jakarta.apache.org/builds/jakarta-commons/nightly/commons-beanutils/

and look in the "src/test" directory for the unit tests.

Unit testing is also one of the foundations of a development approach
called Extreme Programming (XP), so there will be lots of pointers and
examples in the information about XP as well.

> >* Architecture of the web (particularly how HTTP, HTML,
> >and
> >   JavaScript work)
>
> can you elaborate more? As a Software Developer for mostly
> web, I know how the JS and HTML work. But why I should
> know about HTTP?
>

Well, the web runs on HTTP.  The facts that HTTP is synchronous
(request/response) oriented, and stateless, are critically important.
The facts of how security and cookies work are driven by the HTTP
standards.  Little details like the fact that HTTP headers are sent at the
beginning of a message, so you can't usually add them at the end of your
servlet, will help you avoid lots of frustration.

It's sort of like learning to drive -- if you focus on the mechanics of
steering a car, but don't understand the driving laws in your country,
you're likely to have a lot more problems than if you had studied both
:-).

>
> >
> >* The Servlet API -- foundation to every Java-based web
> >application
>
> done. Though, I don't explore them thoroughly. Only, when
> I meet a very special case like how to limit the number of
> access a user can make to the web app, delivering image on
> the fly, creating an excel file, etc.
>

It's fine to learn the details as you need them, but if you haven't done
a pretty complete overview, then how do you know what's there that you
*haven't* needed yet?  Servlets are foundational to understanding JSP.

Craig




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: regular expressions

2003-01-17 Thread Gilbert, Antoine
thx

it work perfectly now.

Antoine


-Message d'origine-
De : Alex [mailto:[EMAIL PROTECTED]]
Envoyé : 16 janvier, 2003 17:46
À : Struts Users Mailing List
Objet : Re: regular expressions



try...
$regex = '[a-zA-Z]*([(].*?[)] [a-zA-Z]+)';

On Thu, 16 Jan 2003, Gilbert, Antoine wrote:

> Hi
>
> Sorry about this out of topic message...
>
> I have a problem with some regular expressions processing...
>
> String input = "(1+f(8,8)) 
>pe,concat(concat(CO_LONGITUDE,';'),CO_LATITUDE) 
>UNIQUEID,CO_LONGITUDE,CO_LATITUDE,count(CO_LONGITUDE) QTE, ant";
> String regex = "[a-zA-Z]*([(].*[)] [a-zA-Z]+)";
> Pattern pattern = Pattern.compile(regex);
> Matcher matcher = pattern.matcher(input);
> while(matcher.find())
> Logger.log(matcher.group());
>
> my first match is : (1+f(8,8)) pe,concat(concat(CO_LONGITUDE,';'),CO_LATITUDE) 
>UNIQUEID,CO_LONGITUDE,CO_LATITUDE,count(CO_LONGITUDE) QTE
>
> I want the first shortest match, i.e. : (1+f(8,8)) pe
>
> I readed a little on some newsgroups. I know its possible in Perl..
>
> But, with the java package, I dunno if its possible. By the way, I m new to regulars 
>expressions...
>
> Antoine
>
>
> Salutations,
>
> __
>
> Antoine Gilbert /   [EMAIL PROTECTED]
> Analyste-programmeur
>
> KOREM
> Technologies de GÉOdiffusion
>
> __
>
> 680, boul. Charest Est, bureau 120
> Québec (Québec) G1K 3J4
>  
>
> Localisation KOREM Qc
> Tél. : (418) 647-1555
> Téléc. : (418) 647-1666
> 1 888 440-1MAP
>
>   www.korem.com
> __
>
> * Partenaire canadien MapInfo de l'année - 2001
> * Meilleur nouveau partenaire MapInfo 2000-Amérique du Nord
>
> __
>
>
>
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: The best way for learning struts (stupid question)

2003-01-17 Thread V. Cekvenich
I will post here when I am ready soon. Glad there is interest, I got 
some private e-mail.

As I plan to donate materials to Jakarta I would like to see if some 
of the Advanced Pros would want to participate, so that one of them 
could teach next online seminar, or maybe even document some of the 
presentation.
.V

Joyce Gu wrote:
Hello,
Do you have the web address and we can refer to when you start your 
training session? I have worked on Strut for seven months now. I learned 
by myself. However, I would like to have a formal training and I really 
like that the idea that you will give home work too.
Thanks

At 08:31 AM 1/16/2003 -0500, you wrote:

http://www.sdtimes.com/news/063/story2.htm
Tomcat has most market share (above) and  best support.
(Check out PostgreSQL and Eclipse).

Re: training:
I plan to do public training "Intermediate Struts" via the Internet, 
in about a month.
4 Sessions Saturdays at 10:15 for about an hour, giving  labs for  
home work due for next week labs. The cost will be only to cover the 
cost of webex, and so that it is not FREE.
It will cover is Struts review, Tiles, Master/Detail, Multi Row 
Update, Option Selections, Development Process, CRUD testing, and how 
to develop very very fast,  etc.

I have done lots of public (and private training) Struts training (and 
won best training by JDJ) and am looking to showcase my training 
approach, so someone else can do this kind of an online training 
seminar next time so I can see other training aproaches(but I would 
like them to take the class first, or even contribute to it, and then 
maybe donate all back to Struts). If I sign up at least 20 people I 
will do it.

.V

(This is not intro to Struts, some pre-reqs for the class are at least 
some MVC, and some books such as "SQL for Smarties",  "Java Web 
Compoent Developer Certification" or at least "JSP Weekend Crash Course")

joni santoso wrote:



* The Servlet API -- foundation to every Java-based web application



It's probably worth throwing in "installing and configuring a servlet
container like Tomcat" at about this point.  Many of us have the 
luxury of
sysadmins who takt that task on, but it's a very useful skill to 
know how
to set Tomcat up on your development PC.

I wonder if Tomcat is used in real and critical application by major 
companies? What other servlet containers out there? I once played 
with orion.
=== 

Meriahkan Hari Valentine Anda dan Ikuti Lomba Desain Kartu Eletronik 
dengan Tema Valentine
Ikuti Polling Pemilihan Pemenang Lomba Desain Kartu Elektronik Natal 
dan Tahun Baru 2003 di http://kartu.plasa.com/lomba
KSI PlasaCom - Reuni Alumni STTTelkom 
http://www.plasa.com/belajar/reuni.html 
=== 





--
To unsubscribe, e-mail:   

For additional commands, e-mail: 



Joyce GuM.S
Scientific Programmer
Biomedical Computing Facility
Baylor College of Medicine
Phone: (713)502-7024(C)
Fax: (713)798-6822
email: [EMAIL PROTECTED]




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




FW: Problem with JDBC & Struts Connection Pool (possible to reconnect?) : Solution/Fix: J/Connector kills unused connections after 8 hours

2003-01-17 Thread mech
You can ignore my last email or read through if you encounter similar
problems and need a fix.
I just found out from the MySQL J/Connector documentation that
connections are cut off after 8 hours of inactivity.


"I have a servlet/application that works fine for a day, and then stops 
  working overnight".

  Resolution: 

  MySQL closes connections after 8 hours of inactivity. You either
  need to use a connection pool that handles stale connections or use
the 
  "autoReconnect" parameter (see "USAGE AND INSTALLATION"). [...]

  

I guess (from my bad experience) that the Struts connection pool can't
handle stale connections so I just added "autoReconnect" to my
struts-config.xml. I hope this fix keeps my webapp work overnight this
time... Tomcat's JDBCRealm seems to handle stale connections
automatically... 
Maybe this would be a nice to have thing for the Struts connection pool,
too?!

BTW: You cannot use "set-property" for those special properties like
"autoReconnect" or "profileSql". They have to be in the connectionURL
like this (I tried it differently with "profileSql" but nothing happend
on stderr):

Use instead similar to:


Thanks anyway.
Michael

-Original Message-
From: mech [mailto:[EMAIL PROTECTED]] 
Sent: Freitag, 17. Januar 2003 12:52
To: '[EMAIL PROTECTED]'
Subject: Problem with JDBC & Struts Connection Pool (possible to
reconnect?)


Hi,

I'm running Tomcat 4.1.18 on Solaris 9 with a local MySQL 3.23.54-max
(InnoDB) database on port 3307 using started with mysqld (not
safemysld...difference btw?).

After not using any connection over night for let's say 12 hours or
more, I get SQLExceptions next morning:

"java.sql.SQLException: Communication link failure:
java.net.SocketException"

In my application I use JDBC for Tomcats security realm feature and
form-based auth. When I try to login for the first time, I get this
error log (see below), but if I try to login twice the db connection
seems to get reset automatically. (A solution I could live with,
although I have now idea why the connection was cut while it should be
idle overnight)

Unfortunatelly my struts connection pool that I use in my application's
data access classes doesn't get reinitialized after such a
SocketException (see below). The only solution so far was to reload or
stop/start the webapp with the Tomcat manager. Bad solution

In my struts-config.xml I already have something to reconnect (see
below), but it obviously didn't do the trick with my
"mysql-connector-java-2.0.14.jar" J/Connector. I simply lost the
connection somehow...

Can anyone give my an hint what happens to my MySQL connections? I don't
seem to have a problem if I send a query from time to time, but if I
wait too long and do nothing, I'm cut off... :-(

In case there's no way to stop this, is there a solution how to tell my
application (a java code snippet would be great...) to reinitialize the
Struts connection pool when this exception is thrown. For Tomcat's
JDBCRealm it is done somehow, how can I reset the MySQL connection for
Struts? I think I could live with a reconnect on the second try for a
query.

Thanks you!
Michael



--













  



EXCEPTION from log file:

(first time to try a login and utilize the connection again after long
idle time) 2003-01-17 12:28:55 JDBCRealm[/praksis]: Exception performing
authentication
java.sql.SQLException: Communication link failure:
java.net.SocketException
at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.PreparedStatement.executeQuery(Unknown Source)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:480)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
5)
at
org.apache.catalina.core.StandardHostValve.i

Re: Struts Modules

2003-01-17 Thread Craig R. McClanahan


On Thu, 16 Jan 2003, Christoph Rooms wrote:

> Date: Thu, 16 Jan 2003 16:11:59 +0100
> From: Christoph Rooms <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Struts Modules
>
> Hi,
>
> I have my Action Servlet  to react with the servlet mapping "/do/*".
>
> I have the feeling this does not work when I am using Struts Modules.
> Anyone who got modules working with this servlet mapping ?
>

>From Section 5.4.2 of the User's Guide:

  WARNING - If you are using the new module support in
  Struts 1.1, you should be aware that *only* extension
  mapping is supported.

> thanks, Christoph
>
> Christoph Rooms

Craig



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




java.lang.String question disguised as an ActionForm question

2003-01-17 Thread Jagdish Arora

ok, though this problem came up dealing with ActionForms, I completely
understand that this is a fundamental Java question, nothing more, so I will
pose it as that only.  Also, I am prepared for taking some
thisQuestion(OrYou)DoesntDeserveToBeHere flak:

String s1 = "" + null;
System.out.println ("s1: " + s1);
if (s1 == null)
System.out.println ("s1 is null");
else
System.out.println ("s1 is not null");

produces output:
s1: null
s1 is not null

While if I replace the first line by, String s1 = "";
then it produces output:
s1:
s1 is not null

(which I have no problem with).

Question: Why does the 1st line of the output of the first case read s1:
null  ?

Amrinder

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




AW: How to set a parameter in an action

2003-01-17 Thread Oliver Kersten
Hi,
thanks for your answer, now we have solved the problem.

We are using our own class (ActionForwardWithParameter) which is extended
from ActionForward. Our class gets the original ActionForward as a parameter
and then (with some tricks) we use our own method to add a parameter. The
return value of the execute() method is our own ActionForwardWithParameter.

ciao Oliver.

-Ursprüngliche Nachricht-
Von: Nicolas De Loof [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 16. Januar 2003 11:26
An: Struts Users Mailing List; [EMAIL PROTECTED]
Betreff: Re: How to set a parameter in an action


Servlet API doesn't allow you to write request attributes (parameters,
headers...)

You can try to forward to a new ActionForward object, build with the mapping
to your "another" action, adding needed parameter with GET syntax :
...
return new ActionForward( NEXT_ACTION_URL + "?param=" + paramValue );
(I'm not sure it will work...)


Another solution is to put param value in request and forward to a JSP that
will redirect browser to the NEXT_ACTION_URL with param added :

# in your action:
request.setAttribute("param", paramValue);
return new ActionForward( "redirect.jsp" );


# redirect.jsp :

  ">


document.forms[0].submit();



Nico.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts app design for multiple client types

2003-01-17 Thread Craig R. McClanahan


On Thu, 16 Jan 2003, Kris Schneider wrote:

> Date: Thu, 16 Jan 2003 16:12:36 -0500
> From: Kris Schneider <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Struts app design for multiple client types
>
> I'm in the process of designing a single web app to support two different client
> types: HTML and VoiceXML. Yes, yes, I know, XSLT is just the ticket. That was my
> initial take at least, but I'd like to bounce some things off the Struts hive
> before committing to it. To add some context, I'll be deploying on a full J2EE
> 1.3 platform, so things like servlet filters and JSTL get to play. I'm also
> aware of existing XML/XSLT solutions like Cocoon, stxx, and StrutsCX and have
> done some preliminary investigation of each. The application itself is generally
> form/data driven. The major issues I'm currently spinning on are the following:
>
> What do the existing solutions offer that I couldn't do with JSTL and relatively
> simple filters? For instance, my JSPs might just become:
>
> 
>   
> 
>
> How difficult would it be to duplicate the functionality of the Struts html and
> nested tags? Those tags do a lot of work on a page author's behalf with respect
> to handling form rendering, indexed form bean properties, transaction tokens,
> URL encoding, etc. If the app is just dumping XML, then it seems like the XSLT
> styleheets could get pretty hairy. I suppose the Struts tags could still be used
> to output XHTML fragments which might make the transforms less painful.
>

Why would it be necessary to add XSLT functionality to Struts tags, when
the  tag already exists.  Or, to put it another way, what
does the  tag (by itself) *not* do that you think would be
helpful?

My gut feel is that further XMLish integration into Struts itself should
focus more on things like defining a processing pipeline in struts-config
-- sort of like Cocoon's sitemap, but not quite so much work.  In other
words, focus on enriching the controller functionality.

Tag libraries like JSTL are designed to interoperate with each other, so
if you happen to be using JSP for output, it makes perfect sense (at least
to me) to use them.

> If you've got some specific insight into those issues, or would just like to
> share your approach to using Struts for apps that support multiple client types,
> I'd love to hear about it. Thanks.
>
> --
> Kris Schneider 
> D.O.Tech   

Craig



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [OT] Date format

2003-01-17 Thread Andrew Hill
Your best bet is to use the static factory methods in the DateFormat class.

ie:
Locale locale = getLocale(request); //Use struts Action method to get locale

dateTimeFormat =
ateFormat.getDateTimeInstance( DateFormat.SHORT,DateFormat.SHORT, locale);
dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale);
timeFormat = DateFormat.getTimeInstance( DateFormat.SHORT, locale);

Its all in the javadocs you know. :-)


In case you were wondering how the java.util.Date.toString() works, heres
its source code:

public String toString() {
DateFormat formatter = null;
if (simpleFormatter != null) {
formatter = (DateFormat)simpleFormatter.get();
}
if (formatter == null) {
/* No cache yet, or cached formatter GC'd */
formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz ",
 Locale.US);
simpleFormatter = new SoftReference(formatter);
}
synchronized (formatter) {
formatter.setTimeZone(TimeZone.getDefault());
return formatter.format(this);
}
}


-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 16 January 2003 22:56
To: [EMAIL PROTECTED]
Subject: Date format


Hi,

Please excuse me for the off-topic question, I need this urgently, so
posting it.

How can I get the current date format? (style: DateFormat.SHORT, locale:
Default)

I used:

SimpleDateFormat formatter = new SimpleDateFormat() ;
String format = formatter.toPattern() ;

It gives:

M/d/yy hh:mm a

But what I want is *only* the date part, excluding the time part of it.

Thanks,
Suresh



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Group of radio buttons with indexed="true" within nested iterate

2003-01-17 Thread Yujin Kim
Hi

I'm having some issues with indexed="true" and nested iterate tags. I'm
hoping some of you would be able to give me some directions.  BTW, I had
to strip out the orignial source code.  I apologize for that if this
makes difficult to follow.  I'd be happy to provide more details in
private channel.

My jsp looks like this:








theForm is the form bean contains the following:
itemList - java.util.List of ItemBean
idValueBeanList - java.util.List of IdValuBean which represents
lookup table in the database

ItemBean is a simple bean that has some properties in primitive data
types that represents a row.
Say ItemBean holds the following properties [ int itemId; int
itemTypeId; String itemName ]

IdValueBean is another simple bean that contains id and value of a
lookup table.
We can presume that IdValueBean represents a single in item_type_lu
lookup table.

So what I need to do is have the html come out as follows
[input type="radio" name="item[0].itemTypeId" value"1"]
[input type="radio" name="item[0].itemTypeId" value"2"]
[input type="radio" name="item[0].itemTypeId" value"3"]
[input type="radio" name="item[0].itemTypeId" value"4"]
[input type="text" name="item[0].itemName" value="some item
name"]

[input type="radio" name="item[1].itemTypeId" value"1"]
[input type="radio" name="item[1].itemTypeId" value"2"]
[input type="radio" name="item[1].itemTypeId" value"3"]
[input type="radio" name="item[1].itemTypeId" value"4"]
[input type="text" name="item[1].itemName" value="some item
name"]

..

But with the above jsp code, I end up having an html code that looks
like this:
[input type="radio" name="item[1].itemTypeId" value"1"]
[input type="radio" name="item[2].itemTypeId" value"2"]
[input type="radio" name="item[3].itemTypeId" value"3"]
[input type="radio" name="item[4].itemTypeId" value"4"]
[input type="text" name="item[0].itemName" value="some item
name"]

[input type="radio" name="item[1].itemTypeId" value"1"]
[input type="radio" name="item[2].itemTypeId" value"2"]
[input type="radio" name="item[3].itemTypeId" value"3"]
[input type="radio" name="item[4].itemTypeId" value"4"]
[input type="text" name="item[1].itemName" value="some item
name"]

...

I was trying to learn how to use nested tag hoping it might solve the
problem, but I didn't quite get how to use it.

Any help would be greatly appreciated.

Thanks

Yujin Kim



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Comparing values of variables

2003-01-17 Thread Craig R. McClanahan


On Thu, 16 Jan 2003, Harinath DP wrote:

> Date: Thu, 16 Jan 2003 17:36:45 +0530
> From: Harinath DP <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts-User <[EMAIL PROTECTED]>
> Subject: Comparing values of variables
>
> Is there a taglib in struts which would allow me to compare a value of a
> variable with a value of another variable. I went thru struts docs and found
> only constants can be compared with  tag
>
> -Hari
>

If you're running on a Servlet 2.3 / JSP 1.2 container, JSTL is right up
your alley:

  
...
  

You can get the code that is the basis of the reference implementation
from:

  http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html

Struts 1.1b3 includes a "struts-el" package (in the contrib directory)
that supports the same kinds of expressions in many Struts tags.  It also
requires Servlet 2.3 / JSP 1.2, and JSTL, to operate.

Craig




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Pasar atributos a un

2003-01-17 Thread Míguel Ángel Mulero Martínez
Hola a todos,
Estoy usando la linea:


para almacenar en la variable text el contenido de la pagina despues de ser
ejecutado. Mi problema es que tengo un bean en la pagina actual que no es
visible para la pagina incluida, por lo tanto quiero pasarselo. ¿Hay alguna
forma de hacer esto? Al estilo del .

Gracias a todos,
Miguel



Re: [OT] RE: Not spam...I swear--

2003-01-17 Thread Kenneth Stout
Nice looking family!

Kenneth.
- Original Message -
From: "Chappell, Simon P" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 8:30 AM
Subject: RE: [OT] RE: Not spam...I swear--


http://simonpeter.com/family/2003/01jan/P1051973.JPG :-)

>-Original Message-
>From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 16, 2003 10:05 AM
>To: 'Struts Users Mailing List'
>Subject: RE: [OT] RE: Not spam...I swear--
>
>
>Maybe, but who would date you?
>
>-Original Message-
>From: Chappell, Simon P [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 16, 2003 10:44 AM
>
>He didn't say I was any good, just up to date! :-P
>
>-Original Message-
>From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 16, 2003 5:39 AM
>
>So much for your school's credentials
>
>-Original Message-
>From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, January 15, 2003 10:09 PM
>
>I could send you my resume if you would like.  The CS program
>I'm in starts
>you in Java your first year and emphasizes on design patterns
>and software
>development.  The material is so up to date that the department even
>requested Simon Chappell (very well
>
>
>
>
>--
>To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: struts servlet-mapping

2003-01-17 Thread Subhrajyoti Moitra

  

will these work??

- Original Message -
From: "Cagan Senturk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 4:30 AM
Subject: struts servlet-mapping


> >
> > Hello,
> > I am using Struts 1.1-b2 and Tomcat4.1.18.
> > My web app is deployed under a context named 'ppp'.
> > In web.xml, url-pattern for struts action servlet is set to '*.do':
> >  
> > action
> > *.do
> >   
> >
> > And in struts-config.xml, I have the following  element setup:
> >  > type="com.emirca.pp.controller.actionhandler.Welcomer"
> > unknown="true"
> > validate="false">
> > 
> >
> > On my server, the following works:
> > http://localhost:8080/ppp/test.do
> >
> > but the following doesn't:
> > http://localhost:8080/ppp/layout/test.do
> >
> > Which means subdirectories within the context are not recognized by
> > struts in this setup...
> > How can I fix this?
> > Thanks in advance.
> > Cagan
> >
> >
> Cagan Senturk
>
> Emirca Technologies, Inc.
> 75 Spring St. Floor #8
> NYC, NY 10012
>
> mailto:[EMAIL PROTECTED]
> http://www.emirca.com
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




problem with ResultSetDynaClass

2003-01-17 Thread usha
Hi

i am stuck with this error from past  2 hrs. can any body tell me what i 
am doing wrong here
i am writing the following code to use with struts

 con = CxcSvcLoc.getInstance().getCxcDataSource().getConnection();
 stmt = con.createStatement();
  rs = stmt.executeQuery("select ivtransbatchid from ivtranshdr");
  ResultSetDynaClass rsdc = new ResultSetDynaClass(rs);
  BasicDynaClass bdc = new BasicDynaClass("foo", 
BasicDynaBean.class, rsdc.getDynaProperties());

  Iterator rows = rsdc.iterator();
  while (rows.hasNext())  {
DynaBean row = (DynaBean) rows.next();
DynaBean newRow = bdc.newInstance();
PropertyUtils.copyProperties(newRow, row);
results.add(row);
  }

the above code is giving the error msg like this , the batchid that i am 
seleting from database is of type Integer.

org.apache.commons.beanutils.ConversionException: Cannot assign value of 
type 'java.lang.Integer' to property 'ivtransbatchid' of type 
'java.lang.Long'
   at 
org.apache.commons.beanutils.BasicDynaBean.set(BasicDynaBean.java:319)
   at 
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1636) 

   at 
org.apache.commons.beanutils.PropertyUtils.copyProperties(PropertyUtils.java:270) 

   at 
com.justcommodity.cxc.jsp.inventory.formbeans.IvTransHdrBean.getBatchidlist(IvTransHdrBean.java:102) 

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

   at java.lang.reflect.Method.invoke(Method.java:324)
   at 
org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1167) 

   at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:754) 

   at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:783) 

   at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:728)
   at 
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:303)
   at 
org.apache.jsp.inventory_0005ftrans_0005flist$jsp._jspService(inventory_0005ftrans_0005flist$jsp.java:94) 

   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201) 

   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683) 

   at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431) 

   at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355) 

   at 
org.apache.struts.actions.ForwardAction.execute(ForwardAction.java:158)
   at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446) 

   at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) 

   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 

   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) 

   at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) 

   at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) 

   at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) 

   at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) 

   at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) 

   at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
   at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 

   at 
org.apache.catalina.core.StandardPipeline.i

Problem with using DynaValidatorForm, is it possible to do it??

2003-01-17 Thread Ashish Kulkarni
Hi,
I am trying to do the following and i get null pointer
exception,
DynaValidatorForm   PL1820UpdateForm = new
DynaValidatorForm();
PL1820UpdateForm.set("input1",  "This is test");

And my form definiation in struts-config is





The error i get it following
java.lang.NullPointerException
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:551)
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:365)
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
com.pfizer.maps.action.sop.PL1820DispatchAction.getData(PL1820DispatchAction.java:197)
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
com.pfizer.maps.action.sop.PL1820DispatchAction.change(PL1820DispatchAction.java:145)

Need help






=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Digester getting recursive tag types.

2003-01-17 Thread Simon Kelly
> Check out the way Struts 1.1 builds a ModuleConfig tree, and extracts it
> out, for ideas on how to handle this.

Is there anywhere I can view this without having to download the source? I'm
drastically out of disk space, and wont be able to get rid of anything for a
week at least.

Cheers

Simon




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Modules

2003-01-17 Thread Mark McBride
I tripped up on this also ... is there a reason why Pre-fix matching 
("/do/*") does not work with the multiple application configuration?

Are there plans on supporting pre-fix matching in the future?

Thanks in advance!

-Mark
At 04:20 PM 1/16/2003 +0100, you wrote:
2003. január 16. 16:11 dátummal Christoph Rooms ezt írtad:
> Hi,
>
> I have my Action Servlet  to react with the servlet mapping "/do/*".
>
> I have the feeling this does not work when I am using Struts Modules.
> Anyone who got modules working with this servlet mapping ?

http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_mapping

Last sentence in the paragraph in RED.

Hth,

Tib

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 






Session lost between Actions using mapping.findForward(HELP)

2003-01-17 Thread Jason Yam
Hi everyone,
 
 I almost finish my project but I have one more problem: "session lost".
I save a session variable named "username" in ProcessLogonFormAction before
I use findForward("homepage") to go to my homepage "homepage.jsp" through
the action DisplayHomePageAction.  DisplayHomePageAction will check the
existence of the session variable "username" to decide whether to forward
the request to the homepage.
 
For the first time, I can see homepage.jsp after clicking the submit
button of the logon.jsp and so DisplayHomePageAction can see the correct
session varaible "username".  However, when I click a link that runs
DisplayHomePageAction again, it shows the logon page instead of homepage.jsp
because the session variable "username" is lost.  In debugger, I see the
session ID is different between Step 6 and Step 7 .  I don't think I have
used session.removeAttribute() and session.invalidate().
 
Here is my program flow:
 
1. DisplayLogonFormAction => 2. logon.jsp => 3. click submit => 4.
ProcessLogonFormAction => 5. DisplayHomePageAction => 6.homepage.jsp
=>7. DisplayHomePageAction => 8.homepage.jsp
 
Is it related to URL not encoded (JSession ID)?  Can someone show me how
to make it work? 
 
Thank you
 
Jason
 
=BEGIN=
 
   public ActionForward perform(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws IOException, ServletException {
  
  Locale locale = getLocale(request);
  MessageResources messages = getResources();
  HttpSession session = request.getSession();
  
  ActionErrors errors = new ActionErrors();
  
  com.epson.auth.LogonForm lfb = (com.epson.auth.LogonForm) form;
  String username = lfb.getUsername();
  String password = lfb.getPassword();
  
  // Remove the obsolete form bean
  if (mapping.getAttribute() != null) {
 if ("request".equals(mapping.getScope()))
request.removeAttribute(mapping.getAttribute());
 else
session.removeAttribute(mapping.getAttribute());
  }
  
  if (!isTokenValid(request))
  {
 System.out.println("(ProcessLogonFormAction.java - perform)
isTokenValid is false=>add error");
 errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("error.transaction.token"));
  }

  if (!errors.empty())
  {
 saveErrors(request, errors);
 saveToken(request);
 return (new ActionForward(mapping.getInput()));
  }
  else
  {
 System.out.println("(ProcessLogonFormAction.java - perform) error
is empty=>resetToken, set session");
 resetToken(request);

 session.setAttribute("username",username); // extra
**
 System.out.println("(ProcessLogonFormAction.java - perform)
username=" + session.getAttribute("username"));

 return (mapping.findForward("homepage"));
  }
  
   }
=END===
 



[OT]: I don't see how this works?

2003-01-17 Thread Simon Kelly
I'm just scanning thru the struts source, looking for ModuleConfig stuff and
ran over this bit of code.

I've never seen anything written like it and wondered what it's doing and
how the hell does it work?

Cheers

Simon


Collections.sort(lActions, new Comparator() {
public int compare(Object o1, Object o2) {
ValidatorAction va1 = (ValidatorAction) o1;
ValidatorAction va2 = (ValidatorAction) o2;
if ((va1.getDepends() == null || va1.getDepends().length() == 0)
&& (va2.getDepends() == null || va2.getDepends().length() == 0)) {
return 0;
} else if (
(va1.getDepends() != null && va1.getDepends().length() > 0)
&& (va2.getDepends() == null || va2.getDepends().length() == 0)) {
return 1;
} else if (
(va1.getDepends() == null || va1.getDepends().length() == 0)
&& (va2.getDepends() != null && va2.getDepends().length() > 0)) {
return -1;
} else {
return va1.getDependencies().size() - va2.getDependencies().size();
}
}
});
Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [OT] RE: Not spam...I swear--

2003-01-17 Thread Andrew Hill
An archeologist?

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 January 2003 00:05
To: 'Struts Users Mailing List'
Subject: RE: [OT] RE: Not spam...I swear--


Maybe, but who would date you?

-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 10:44 AM

He didn't say I was any good, just up to date! :-P

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 5:39 AM

So much for your school's credentials

-Original Message-
From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 10:09 PM

I could send you my resume if you would like.  The CS program I'm in starts
you in Java your first year and emphasizes on design patterns and software
development.  The material is so up to date that the department even
requested Simon Chappell (very well




--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Un Subscribe

2003-01-17 Thread Joel Rees
???

> I apriciate that pun was probibly not the correct word but

I thought 

   You can _checkout_ any time you like, ...

Oh, wait, this isn't the dev list.

;->

-- 
Joel Rees <[EMAIL PROTECTED]>

> 
> - Original Message -
> ...
> What pun are you referring to?
> ...
> > -Original Message-
> > ...
> > That was a very bad pun, and requires all users to be over 30. ;-)
> >
> > - Original Message -
> > ...
> > You can check out any time you like, but you can never leave...
> >


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: struts servlet-mapping

2003-01-17 Thread Cagan Senturk
The thing is the /layout directory is determined at run-time; I don't 
know what it will be a deployment time.
Thanks,
Cagan
On Thursday, January 16, 2003, at 06:18  PM, [EMAIL PROTECTED] 
wrote:

If you want your action to be available from
http://localhost:8080/ppp/layout/test.do
then you need to make a mapping like this:





Regards,

Geoff Bennett


Multitask Consulting Pty Ltd
Level 8, 20 Loftus Street, Sydney NSW 2000 Australia
Tel +61 2 9252 1462Fax +61 2 9252 4636
www.multitask.com.auemail: [EMAIL PROTECTED]





Cagan Senturk <[EMAIL PROTECTED]>
17/01/2003 10:00 AM
Please respond to "Struts Users Mailing List"

To: [EMAIL PROTECTED]
cc:
Subject:struts servlet-mapping





Hello,
I am using Struts 1.1-b2 and Tomcat4.1.18.
My web app is deployed under a context named 'ppp'.
In web.xml, url-pattern for struts action servlet is set to '*.do':
 
action
*.do
  

And in struts-config.xml, I have the following  element setup:



On my server, the following works:
http://localhost:8080/ppp/test.do

but the following doesn't:
http://localhost:8080/ppp/layout/test.do

Which means subdirectories within the context are not recognized by
struts in this setup...
How can I fix this?
Thanks in advance.
Cagan



Cagan Senturk

Emirca Technologies, Inc.
75 Spring St. Floor #8
NYC, NY 10012

mailto:[EMAIL PROTECTED]
http://www.emirca.com


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




Cagan Senturk

Emirca Technologies, Inc.
75 Spring St. Floor #8
NYC, NY 10012

mailto:[EMAIL PROTECTED]
http://www.emirca.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




html:message footer printed without header or messages

2003-01-17 Thread Cory McIlroy
has this happened to anyone else?

sometimes, in situations that i can not reproduce,
when there are no messages, the html:messages tag
prints the footer without printing the header.

it is a bug as far as i can tell.

cory

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Struts Validator Problem

2003-01-17 Thread Suresh Addagalla
Hi,

I am facing a problem with Validator while doing client-side validation.

IE is throwing the following error dialog when I submit the form:

"type" is null or not an object

The corresponding source code (validator generated) line the *second*
line below:

for (x in oRequired) {
if ((form[oRequired[x][0]].type == 'text' ||
 form[oRequired[x][0]].type == 'textarea' ||
 form[oRequired[x][0]].type == 'select-one' ||
 form[oRequired[x][0]].type == 'radio' ||
 form[oRequired[x][0]].type == 'password') &&
(form[oRequired[x][0]].value == '')) {

Please let me know if anyone knows how to fix this problem.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Pasa artributwa to a (SORRY FOR MY EARLIER SPANISH POST)

2003-01-17 Thread Míguel Ángel Mulero Martínez
Hi to all,
I’m using the sentence:


to save in “text” the content of the page after its execution. My problem is
that I’ve got a bean in the actual page that it’s not visible for the
included page. How can I pass it? Something similar to ?

Thanks to all!
Miguel




Re: Struts application

2003-01-17 Thread Giri Alwar
Can you post the stack trace? Do you know where the exception occurs
(Servlet, Action, accept.jsp)?

- Original Message -
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 5:18 PM
Subject: Struts application


> I applied struts in the simplest form and received the below error
message.
> This application resides on a Weblogic 6.0 server.
>
> Scenario:
> It involves two JSP's, two form classes and an action class.  The
Index.jsp
> is loaded first where you key in the username and click the ok submit
> button. It takes you to the other jsp, accept.jsp, which displays the user
> name.
>
> In the backend, when you click the button on the index.jsp, the value of
> the username is taken to the form bean and in the action class the data
> from the form bean of the index.jsp is retrieved and stored in the form
> bean of the the accept.jsp and the jsp is loaded.  It automatically gets
> the data from the form bean and displays  it on  the accept.jsp.
>
>
> Problem:
> The problem I'm having is once I click on the ok button from the index.jsp
> I get the following error message displayed from weblogic:
>
>
>
>
>   
> <[WebAppServletContext(6821348,wrox-struts,/wrox-struts)] Servlet failed
> with Exception java.lang.NullPointerException
>
>
>
>
>
> It's set up in the below structure:
>
>
>
>
>
>
>  (Embedded image moved to file: pic04734.gif)
>
>

>
>
>
>
>
> Can anyone help??
>
> Thanks.
>
> CONFIDENTIAL MATERIAL.  This electronic message contains information from
> Princeton eCom Corporation, is confidential and may be privileged.  It is
> intended for the use of the addressee only.  If you are not the addressee
> indicated in this message (or responsible for delivery of the message to
> such person), any disclosure, copy, distribution or use of the contents of
> this message is prohibited.  Please destroy this message and notify us
> immediately if this is the case by sending a reply to this message or by
> sending an e-mail to [EMAIL PROTECTED] and by destroying all
> copies of this message and any attachments. Thank you.  For more
> information about Princeton eCom Corporation, please visit us at
> http://www.princetonecom.com
>
>






> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 1/2/2003

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Validator and Form Bean

2003-01-17 Thread Suresh Addagalla
Hi,

Does Struts Validator *pass back* the form bean object if a validation
fails? Or does it pass back only the errors?

My scenario is as follows. I have a page for creating a "Service". I
enter all the data and submit it. Assume that the validation fails. In
this case, along with the error message, I should display the submitted
values so that the user can correct them and re-submit. But now, my
whole form is not getting displayed because I am not getting the form
bean back. Any thing I am missing? **Must the form bean be in session
scope if I want this functionality?**

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Struts application

2003-01-17 Thread du Plessis, Corneil C
Sounds like the scope on the form you submitted first may be request scope
instead of session scope.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 17 January, 2003 01:18
To: Struts Users Mailing List
Subject: Struts application


I applied struts in the simplest form and received the below error message.
This application resides on a Weblogic 6.0 server.

Scenario:
It involves two JSP's, two form classes and an action class.  The Index.jsp
is loaded first where you key in the username and click the ok submit
button. It takes you to the other jsp, accept.jsp, which displays the user
name.

In the backend, when you click the button on the index.jsp, the value of
the username is taken to the form bean and in the action class the data
from the form bean of the index.jsp is retrieved and stored in the form
bean of the the accept.jsp and the jsp is loaded.  It automatically gets
the data from the form bean and displays  it on  the accept.jsp.


Problem:
The problem I'm having is once I click on the ok button from the index.jsp
I get the following error message displayed from weblogic:




  
<[WebAppServletContext(6821348,wrox-struts,/wrox-struts)] Servlet failed
with Exception java.lang.NullPointerException





It's set up in the below structure:






 (Embedded image moved to file: pic04734.gif)   







Can anyone help??

Thanks.

CONFIDENTIAL MATERIAL.  This electronic message contains information from
Princeton eCom Corporation, is confidential and may be privileged.  It is
intended for the use of the addressee only.  If you are not the addressee
indicated in this message (or responsible for delivery of the message to
such person), any disclosure, copy, distribution or use of the contents of
this message is prohibited.  Please destroy this message and notify us
immediately if this is the case by sending a reply to this message or by
sending an e-mail to [EMAIL PROTECTED] and by destroying all
copies of this message and any attachments. Thank you.  For more
information about Princeton eCom Corporation, please visit us at
http://www.princetonecom.com


__

Disclaimer and confidentiality note


Everything in this e-mail and any attachments relating to the official business of 
Standard Bank Group Limited is proprietary to the company. It is confidential, legally 
privileged and protected by law. Standard Bank does not own and endorse any other 
content. 
Views and opinions are those of the sender unless clearly stated as being that of 
Standard Bank. 

The person addressed in the e-mail is the sole authorised recipient. Please notify the 
sender 
immediately if it has unintentionally reached you and do not read, disclose or use the 
content
in any way. 

Standard Bank can not assure that the integrity of this communication has been 
maintained nor 
that it is free of errors, virus, interception or interference.

__

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Indexed Properties and Population

2003-01-17 Thread Jeff_Mychasiw

David says:
"One implementation that should work based on your example
as long as you are willing to create a child factory is in the commons
collection package and is ListUtils.lazyList, which takes a List and
factory."

I have used this as well, in combination with the nested tag library.
We have  a page that displays and updates a List of Value Objects where
each have two internal Lists of Value Objects.
The structure of value objects are sent to me from the back end as such:

CustomerList
  CustomerVo 1
creditVo1   invoiceVo1
creditVo2   invoiceVo2
.   .

  CustomerVo2
creditVo1   invoiceVo1
creditVo2   invoiceVo2
.   .


I would be curious to know  this would done without the nested tags and
lazy list.








"David Morris" <[EMAIL PROTECTED]> on 01/16/2003 03:50:10 PM

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

To:<[EMAIL PROTECTED]>
cc:

Subject:Re: Indexed Properties and Population


Matt,

You really don't need to know how many there are, just create them
on demand. You can intercept gets and auto-extend the underlying
Collection. One implementation that should work based on your example
as long as you are willing to create a child factory is in the commons

collection package and is ListUtils.lazyList, which takes a List and
factory.

David Morris

>>> [EMAIL PROTECTED] 01/16/03 02:31PM >>>
I have an ArrayList on a form... let's call the form Parent and the
ArrayList Children.

If I have:

private ArrayList children;

public void setChildren(int index, ChildForm childForm) {
 this.children.set(index, childForm);
}

Then saving my form results in a NPE for BeanUtils.copyProperties.  If
I
create a whole bunch of objects in the ArrayList in the constructor -
I
avoid this problem:

public ParentForm () {
children = new ArrayList(100);
for (int i=0; i < 100; i++) {
children.add(new ChildForm());
}

But I'm guessing that this fits better into the reset(mapping,
request)
method of my form.  My question is - how do I determine how many there
are?
Is there something in the request this this information - or should I
set a
hidden field with the number of children?

Thanks,

Matt

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








--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Application scope variables

2003-01-17 Thread Suresh Addagalla
Hi,

Thanks for the suggestion. Can someone outline the procedure for storing
ServletContext attributes through a strust plug-in? I really couldn't
find much help on the web to start working on the plug-in related
things.

Thanks,
Suresh

>-Original Message-
>From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
>Sent: Thursday, January 09, 2003 12:36 PM
>To: Struts Users Mailing List; [EMAIL PROTECTED]
>Subject: Re: Application scope variables
>
>
>
>
>My recommendation is to set up shared stuff like this as servlet
context attributes, either in a PlugIn (Struts 1.1) or a
ServletContextListener (Servlet 2.3). Anything stored as servlet context
attributes is instantly available as application scope beans in a JSP
page, through standard JSP tags, through PageContext.APPLICATION_SCOPE,
or any other way you want to do it.
>
>Craig


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


regular expression help

2003-01-17 Thread Raible, Matt
Anyone know a good regular expression translator - or the equivalent of
allowing "+", "-" or " "?

Thanks,

Matt


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts application

2003-01-17 Thread Daniel Jaffa
That is a great picture of what you are doing, but your question does not
help anyone help you.

1 Did you do any logging in your action to see where the null pointer is
being generated.  At least put some System.err.println(); in you code to see
where you are failing.
2. Are you sure that it is even getting to you action.
3. Is your manager causing the problem.

I use weblogic 6.1sp2 and use Log4J to log my app, if you are not currently
using it I would suggest that you do.
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 6:18 PM
Subject: Struts application


> I applied struts in the simplest form and received the below error
message.
> This application resides on a Weblogic 6.0 server.
>
> Scenario:
> It involves two JSP's, two form classes and an action class.  The
Index.jsp
> is loaded first where you key in the username and click the ok submit
> button. It takes you to the other jsp, accept.jsp, which displays the user
> name.
>
> In the backend, when you click the button on the index.jsp, the value of
> the username is taken to the form bean and in the action class the data
> from the form bean of the index.jsp is retrieved and stored in the form
> bean of the the accept.jsp and the jsp is loaded.  It automatically gets
> the data from the form bean and displays  it on  the accept.jsp.
>
>
> Problem:
> The problem I'm having is once I click on the ok button from the index.jsp
> I get the following error message displayed from weblogic:
>
>
>
>
>   
> <[WebAppServletContext(6821348,wrox-struts,/wrox-struts)] Servlet failed
> with Exception java.lang.NullPointerException
>
>
>
>
>
> It's set up in the below structure:
>
>
>
>

>
>
>  (Embedded image moved to file: pic04734.gif)
>
>
>
>
>
>
>
> Can anyone help??
>
> Thanks.
>
> CONFIDENTIAL MATERIAL.  This electronic message contains information from
> Princeton eCom Corporation, is confidential and may be privileged.  It is
> intended for the use of the addressee only.  If you are not the addressee
> indicated in this message (or responsible for delivery of the message to
> such person), any disclosure, copy, distribution or use of the contents of
> this message is prohibited.  Please destroy this message and notify us
> immediately if this is the case by sending a reply to this message or by
> sending an e-mail to [EMAIL PROTECTED] and by destroying all
> copies of this message and any attachments. Thank you.  For more
> information about Princeton eCom Corporation, please visit us at
> http://www.princetonecom.com
>
>






> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Digester getting recursive tag types.

2003-01-17 Thread Simon Kelly
I'm having a dig thru the source code, but I can't seem to find the tree
building bit.  Could you tell me the class this is done in?

Cheers

Simon

PS
Nice bit of coding ;-)

- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 7:01 PM
Subject: Re: Digester getting recursive tag types.


>
>
> On Thu, 16 Jan 2003, Simon Kelly wrote:
>
> > Date: Thu, 16 Jan 2003 14:52:11 +0100
> > From: Simon Kelly <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: Digester getting recursive tag types.
> >
> > Hi all,
> >
> > I am trying to load a set of beans using the Digester.  One of the beans
> > (Menu) will contain beans of the same type within.  The basic layout of
a
> > page follows with what I think is the correct way of dragging in
recursive
> > tags (IE SubMenu is of type Menu).  Can anyone verify if this is even in
the
> > right ball park?
> >
>
> Two suggestions:
>
> * In your property setter rules, you'll want to specify
>   the name of the JavaBean property in lower case, not
>   capitalized.
>
> * For the recursive rule, Digester doesn't recognize
>   an asterisk in the middle.  Just simplify this to:
>   "*/SubMenu".
>
>
> > Cheers
> >
> > Simon.
> >
> > PS
> > I can't run it yet cause I'm only part way through workig out how to
extract
> > it all afterwards.
> >
>
> Check out the way Struts 1.1 builds a ModuleConfig tree, and extracts it
> out, for ideas on how to handle this.
>
> Craig
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem with JDBC & Struts Connection Pool (possible torecon nect?)

2003-01-17 Thread Raible, Matt
Add autoReconnect=true to your connectionURL, as in:

 connectionURL=
"jdbc:mysql://localhost/roller?autoReconnect=true&user=roller&passwo
rd=tiger"

-Original Message-
From: mech [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 4:52 AM
To: [EMAIL PROTECTED]
Subject: Problem with JDBC & Struts Connection Pool (possible to
reconnect?)


Hi,

I'm running Tomcat 4.1.18 on Solaris 9 with a local MySQL 3.23.54-max
(InnoDB) database on port 3307 using started with mysqld (not
safemysld...difference btw?).

After not using any connection over night for let's say 12 hours or
more, I get SQLExceptions next morning:

"java.sql.SQLException: Communication link failure:
java.net.SocketException"

In my application I use JDBC for Tomcats security realm feature and
form-based auth. When I try to login for the first time, I get this
error log (see below), but if I try to login twice the db connection
seems to get reset automatically. (A solution I could live with,
although I have now idea why the connection was cut while it should be
idle overnight)

Unfortunatelly my struts connection pool that I use in my application's
data access classes doesn't get reinitialized after such a
SocketException (see below). The only solution so far was to reload or
stop/start the webapp with the Tomcat manager. Bad solution

In my struts-config.xml I already have something to reconnect (see
below), but it obviously didn't do the trick with my
"mysql-connector-java-2.0.14.jar" J/Connector. I simply lost the
connection somehow...

Can anyone give my an hint what happens to my MySQL connections? I don't
seem to have a problem if I send a query from time to time, but if I
wait too long and do nothing, I'm cut off... :-(

In case there's no way to stop this, is there a solution how to tell my
application (a java code snippet would be great...) to reinitialize the
Struts connection pool when this exception is thrown. For Tomcat's
JDBCRealm it is done somehow, how can I reset the MySQL connection for
Struts? I think I could live with a reconnect on the second try for a
query.

Thanks you!
Michael



--













  



EXCEPTION from log file:

(first time to try a login and utilize the connection again after long
idle time)
2003-01-17 12:28:55 JDBCRealm[/praksis]: Exception performing
authentication
java.sql.SQLException: Communication link failure:
java.net.SocketException
at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.PreparedStatement.executeQuery(Unknown Source)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:480)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
5)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(Stand

RE: contravariance

2003-01-17 Thread Mark Galbreath
Thanks, Dan...

I love the theory behind this kind of stuff!  Where can I get Cardelli's
paper?

Mark

-Original Message-
From: Dan Jacobs [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 7:04 PM

Hi Mark,

Contravariance is generally easiest to understand in the context of 
aggregation.  Consider the parameterized types (looking ahead to Java 
generics) List and List, and variables fruitList and 
bananaList, and assuming that Banana is a subtype of Fruit.  Even though 
it should be ok in a polymorphic language to assign a value of [static] 
type Banana to a variable with a type of Fruit, it should be legal to 
assign a List to the variable fruitList.  If you did, then 
static typing would indicate that you could add an Apple to that list, 
and that would be wrong!  It has to do with *static* (i.e. compile-time) 
typing, which is the kind of typing that makes most Java programs easy 
to understand.

There are some excellent papers by Luca Cardelli that deal with this in 
a much more rigorous manner, but they're not fun to read to your friends 
at parties :-).

In the context of this thread, contravariance is the mathmatical 
relation between types that exposes the dark side of inheritance.  This 
usually shows up when an "is-a-part-of" relationship is implemented as 
an "is-a-kind-of" relationship.  This results in a subclass that has 
operations that don't make sense for the superclass, or are just 
contradictory when applied to the superclass.  That's what I'm claiming 
is the problem with the current implement of form-beans.

-- Dan



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Display values after validation (was RE: action input)

2003-01-17 Thread Gemes Tibor
2003. január 17. 14:22 dátummal Susan Bradeen ezt írtad:
> But by using an action path for input instead of a JSP, isn't the
> ActionForm reset, so you no longer have your form values to show in the
> JSP again? How do you redisplay the incorrect values the user typed into
> the JSP?

The request is the same, so all the paramers are still in the request, and 
they will be populated.

Hth,

Tib

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Display values after validation (was RE: action input)

2003-01-17 Thread pqin
It only resets numeric. For example, there is an amount property of your
bean which is a Double. If you enter abc and submit, abc is reset to 0.0. To
avoid this, change Double to String so struts can keep the original value.

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED]] 
Sent: January 17, 2003 8:23 AM
To: Struts Users Mailing List
Subject: Display values after validation (was RE: action input)

But by using an action path for input instead of a JSP, isn't the 
ActionForm reset, so you no longer have your form values to show in the 
JSP again? How do you redisplay the incorrect values the user typed into 
the JSP? 

Susan Bradeen

On 01/16/2003 03:22:14 PM "Mark Galbreath" wrote:

> Try it and see.
> 
> input is the application-relative path to the input form to which 
control
> should be returned if a validation error is encountered and you have to
> specify the name attribute of the form bean associated with the action.
> 
> Mark
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: action input
> 
> 
>  input="mypage.jsp">
> 
> 
> 
> Can I set input="myAction2.do"?
> 
> 
> 
> Regards,
> 
> 
> 
> 
> 
> 
> 
> PQ
> 
> 
> 
> "This Guy Thinks He Knows Everything"
> 
> "This Guy Thinks He Knows What He Is Doing"
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail: 

> For additional commands, e-mail: 

> 

--
To unsubscribe, e-mail:

For additional commands, e-mail:




RE: regular expressions

2003-01-17 Thread Gilbert, Antoine
thx

it work perfectly now.

Antoine

-Message d'origine-
De : Alex [mailto:[EMAIL PROTECTED]]
Envoyé : 16 janvier, 2003 17:46
À : Struts Users Mailing List
Objet : Re: regular expressions



try...
$regex = '[a-zA-Z]*([(].*?[)] [a-zA-Z]+)';

On Thu, 16 Jan 2003, Gilbert, Antoine wrote:

> Hi
>
> Sorry about this out of topic message...
>
> I have a problem with some regular expressions processing...
>
> String input = "(1+f(8,8)) 
>pe,concat(concat(CO_LONGITUDE,';'),CO_LATITUDE) 
>UNIQUEID,CO_LONGITUDE,CO_LATITUDE,count(CO_LONGITUDE) QTE, ant";
> String regex = "[a-zA-Z]*([(].*[)] [a-zA-Z]+)";
> Pattern pattern = Pattern.compile(regex);
> Matcher matcher = pattern.matcher(input);
> while(matcher.find())
> Logger.log(matcher.group());
>
> my first match is : (1+f(8,8)) pe,concat(concat(CO_LONGITUDE,';'),CO_LATITUDE) 
>UNIQUEID,CO_LONGITUDE,CO_LATITUDE,count(CO_LONGITUDE) QTE
>
> I want the first shortest match, i.e. : (1+f(8,8)) pe
>
> I readed a little on some newsgroups. I know its possible in Perl..
>
> But, with the java package, I dunno if its possible. By the way, I m new to regulars 
>expressions...
>
> Antoine
>
>
> Salutations,
>
> __
>
> Antoine Gilbert /   [EMAIL PROTECTED]
> Analyste-programmeur
>
> KOREM
> Technologies de GÉOdiffusion
>
> __
>
> 680, boul. Charest Est, bureau 120
> Québec (Québec) G1K 3J4
>  
>
> Localisation KOREM Qc
> Tél. : (418) 647-1555
> Téléc. : (418) 647-1666
> 1 888 440-1MAP
>
>   www.korem.com
> __
>
> * Partenaire canadien MapInfo de l'année - 2001
> * Meilleur nouveau partenaire MapInfo 2000-Amérique du Nord
>
> __
>
>
>
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread James Childers

> Please, where can I download the Microsoft Javascript
> Debugging Tool to use with Internet Explorer?
> 
> Thanks,
> Joao Paulo.
> 

I don't know about that, but Mozilla comes with a pretty good JavaScript debugger 
("Venkman") built in. It appears to be more robust than the MS JavaScript debugger, 
although I'm not entirely sure about this because I haven't gotten very good with it 
yet. :)

-= J

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: AW: Refresh on MSIE, PLEASE HELP!! NOT SOLVED

2003-01-17 Thread Mark Galbreath
Unfortunately, IE pretty much ignores Pragma header settings.  The best you
can do is go to Tools -> Internet Options -> Temporary Internet Files ->
Settings -> Check for newer versions on every visit to page.

Mark

-Original Message-
From: Karim Saloojee [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 15, 2003 8:34 AM

I know that in IE you sometimes have to set the response headers in Java,
e.g:

<%
response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires",
0); response.setHeader("Cache-Control", "no-cache"); %>

Put that in skel.jsp.

One last thing, make sure you have cleared out your IE cache before
re-testing (Tools > Internet Options > Delete Files > Delete All Offline
Content > Ok).



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: The best way for learning struts (stupid question)

2003-01-17 Thread Mark Galbreath
You can also join the design patterns user group:

http://archives.java.sun.com/archives/j2eepatterns-interest.html


Mark

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 12:02 AM
To: Struts Users Mailing List
Subject: Re: The best way for learning struts (stupid question)


Snipping to just the questions.

On Thu, 16 Jan 2003, joni santoso wrote:

> >* Design patterns (at the programming level)
>
> any good sites for learning this? I read already the theoretical ones 
> but at the programming level, sometimes I'm still confused to use 
> which DP.
>

The classic text (and the one that really popularized the notion of caring
about the "design patterns" concept) is by four authors colloquially known
as the "Gang of Four" (or GoF):

  Gamma, Helms, Johnson, Vlissides, DESIGN PATTERNS:  ELEMENTS
OF REUSABLE OBJECT-ORIENTED SOFTWARE, Addison-Wesley, 1995.

Punch "design patterns" into Google or Amazon and you'll find lots of info
sources, including many focused on Java or J2EE (servlet/JSP are the
standard web tier technologies for J2EE).

On "when to use which patterns", it's a skill that comes from practice and
experience.  However, I'd start by seeing if your problem space is similar
to things in the "Applicability" section of many pattern descriptions. And
check the "Consequence" (both good and bad) to see if applying this pattern
would help you towards better results.

> >
> >* Unit testing concepts and test-first design (JUnit is a wonderful
> >   tool for this in the Java space)
>
> I learned this too. But, it seems that there're a few tutorial on 
> JUnit. Can anyone here refer me?
>

There's some philosophical and introductory stuff on the JUnit web site
(www.junit.org).  But JUnit is primarily a tool to implement a philosophy
-- the philosophy of "unit testing" as a discipline.  You might want to
search for that term to get some references.

One thing you might want to do is download the source code to a small bit of
code that is heavily unit tested (such as commons-beanutils that Struts
uses), and see what we did -- the intent was to write tests for every
possible invocation of every possible method.  Having the tests in place
does two primary things for us:
* Documented proof that the method being tested behaves
  according to it's (Javadoc) specification
* Protection from future developers making changes and
  inadvertently changing the behavior that users of the
  code depend on.

You can grab a source distro of commons-beanutils (pick any recent nightly
build) at:

 
http://jakarta.apache.org/builds/jakarta-commons/nightly/commons-beanutils/

and look in the "src/test" directory for the unit tests.

Unit testing is also one of the foundations of a development approach called
Extreme Programming (XP), so there will be lots of pointers and examples in
the information about XP as well.

> >* Architecture of the web (particularly how HTTP, HTML,
> >and
> >   JavaScript work)
>
> can you elaborate more? As a Software Developer for mostly web, I know 
> how the JS and HTML work. But why I should know about HTTP?
>

Well, the web runs on HTTP.  The facts that HTTP is synchronous
(request/response) oriented, and stateless, are critically important.
The facts of how security and cookies work are driven by the HTTP
standards.  Little details like the fact that HTTP headers are sent at the
beginning of a message, so you can't usually add them at the end of your
servlet, will help you avoid lots of frustration.

It's sort of like learning to drive -- if you focus on the mechanics of
steering a car, but don't understand the driving laws in your country,
you're likely to have a lot more problems than if you had studied both
:-).

>
> >
> >* The Servlet API -- foundation to every Java-based web
> >application
>
> done. Though, I don't explore them thoroughly. Only, when
> I meet a very special case like how to limit the number of
> access a user can make to the web app, delivering image on
> the fly, creating an excel file, etc.
>

It's fine to learn the details as you need them, but if you haven't done
a pretty complete overview, then how do you know what's there that you
*haven't* needed yet?  Servlets are foundational to understanding JSP.

Craig




--
To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Display values after validation (was RE: action input)

2003-01-17 Thread Robert Taylor
Susan,

since the request is being forwarded (and not redirected) , then it (the
request) still contains the invalid user input and although the form is
being reset, since the request still has the user input, the form fields
should be repopulated with the users original (incorrect) values.

robert

> -Original Message-
> From: Susan Bradeen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 8:23 AM
> To: Struts Users Mailing List
> Subject: Display values after validation (was RE: action input)
>
>
> But by using an action path for input instead of a JSP, isn't the
> ActionForm reset, so you no longer have your form values to show in the
> JSP again? How do you redisplay the incorrect values the user typed into
> the JSP?
>
> Susan Bradeen
>
> On 01/16/2003 03:22:14 PM "Mark Galbreath" wrote:
>
> > Try it and see.
> >
> > input is the application-relative path to the input form to which
> control
> > should be returned if a validation error is encountered and you have to
> > specify the name attribute of the form bean associated with the action.
> >
> > Mark
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 16, 2003 2:58 PM
> > To: [EMAIL PROTECTED]
> > Subject: action input
> >
> >
> >  > input="mypage.jsp">
> >
> >
> >
> > Can I set input="myAction2.do"?
> >
> >
> >
> > Regards,
> >
> >
> >
> >
> >
> >
> >
> > PQ
> >
> >
> >
> > "This Guy Thinks He Knows Everything"
> >
> > "This Guy Thinks He Knows What He Is Doing"
> >
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Display values after validation (was RE: action input)

2003-01-17 Thread Mark Galbreath
Like I said, "Try it and see."  I've never tried it, and apparently no one
else here has either.  Let us know how it turns out.

Mark

-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 8:23 AM


But by using an action path for input instead of a JSP, isn't the 
ActionForm reset, so you no longer have your form values to show in the 
JSP again? How do you redisplay the incorrect values the user typed into 
the JSP? 

Susan Bradeen

On 01/16/2003 03:22:14 PM "Mark Galbreath" wrote:

> Try it and see.
> 
> input is the application-relative path to the input form to which
control
> should be returned if a validation error is encountered and you have 
> to specify the name attribute of the form bean associated with the 
> action.
> 
> Mark
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: action input
> 
> 
>  input="mypage.jsp">
> 
> 
> 
> Can I set input="myAction2.do"?
> 
> 
> 
> Regards,
> 
> 
> 
> 
> 
> 
> 
> PQ
> 
> 
> 
> "This Guy Thinks He Knows Everything"
> 
> "This Guy Thinks He Knows What He Is Doing"
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

> 

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread Mark Galbreath
There's no such thing.  You are thinking of the M$ VBScript debugger, which
comes with (at least) IE 6.0.  If you use Navigator, entering
"about:javascript" in the location field will return error messages.

Mark

-Original Message-
From: João Paulo Batistella [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 8:30 AM


Please, where can I download the Microsoft Javascript
Debugging Tool to use with Internet Explorer?



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[Ignore this mail]

2003-01-17 Thread Simon Kelly

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [OT] Date format

2003-01-17 Thread Suresh Addagalla
Hi,

What I am looking for is how to display the *format*, and not how to
display a date in a given format. So, there doesn't seem to be anything
provided with the API.

I need a method like "toPattern()" of SimpleDateFormat in the DateFormat
class because getDateInstance() returns me DateFormat and not
SimpleDateFormat.

Suresh

>-Original Message-
>From: Andrew Hill [mailto:[EMAIL PROTECTED]] 
>Sent: Friday, January 17, 2003 9:11 AM
>To: Struts Users Mailing List
>Subject: RE: [OT] Date format
>
>
>Your best bet is to use the static factory methods in the 
>DateFormat class.
>
>ie:
>Locale locale = getLocale(request); //Use struts Action method 
>to get locale
>
>dateTimeFormat =
>ateFormat.getDateTimeInstance( 
>DateFormat.SHORT,DateFormat.SHORT, locale);
>dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale);
>timeFormat = DateFormat.getTimeInstance( DateFormat.SHORT, locale);
>
>Its all in the javadocs you know. :-)
>
>
>In case you were wondering how the java.util.Date.toString() 
>works, heres
>its source code:
>
>public String toString() {
>   DateFormat formatter = null;
>   if (simpleFormatter != null) {
>   formatter = (DateFormat)simpleFormatter.get();
>   }
>   if (formatter == null) {
>   /* No cache yet, or cached formatter GC'd */
>   formatter = new SimpleDateFormat("EEE MMM dd 
>HH:mm:ss zzz ",
>Locale.US);
>   simpleFormatter = new SoftReference(formatter);
>   }
>synchronized (formatter) {
>formatter.setTimeZone(TimeZone.getDefault());
>return formatter.format(this);
>}
>}
>
>
>-Original Message-
>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, 16 January 2003 22:56
>To: [EMAIL PROTECTED]
>Subject: Date format
>
>
>Hi,
>
>Please excuse me for the off-topic question, I need this urgently, so
>posting it.
>
>How can I get the current date format? (style: 
>DateFormat.SHORT, locale:
>Default)
>
>I used:
>
>SimpleDateFormat formatter = new SimpleDateFormat() ;
>String format = formatter.toPattern() ;
>
>It gives:
>
>M/d/yy hh:mm a
>
>But what I want is *only* the date part, excluding the time part of it.
>
>Thanks,
>Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: java.lang.String question disguised as an ActionForm question

2003-01-17 Thread Andrew Hill
Because in a string concatenation operation null will be converted to "null"
automatically.
Useful in debugging this is.
ie:
log.debug("value of bob=" + bob);

is a lot easier than always having to write

if(bob == null)
  log.debug("value of bob=null");
else
  log.debug("value of bob=" + bob);

Which you would have to do if it was converted to an empty string, or threw
a NullPointerException if you tried to output it...

-Original Message-
From: Jagdish Arora [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 January 2003 16:31
To: Struts Users Mailing List
Subject: java.lang.String question disguised as an ActionForm question



ok, though this problem came up dealing with ActionForms, I completely
understand that this is a fundamental Java question, nothing more, so I will
pose it as that only.  Also, I am prepared for taking some
thisQuestion(OrYou)DoesntDeserveToBeHere flak:

String s1 = "" + null;
System.out.println ("s1: " + s1);
if (s1 == null)
System.out.println ("s1 is null");
else
System.out.println ("s1 is not null");

produces output:
s1: null
s1 is not null

While if I replace the first line by, String s1 = "";
then it produces output:
s1:
s1 is not null

(which I have no problem with).

Question: Why does the 1st line of the output of the first case read s1:
null  ?

Amrinder

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Validator and Form Bean

2003-01-17 Thread Suresh Addagalla
Hi,

Does Struts Validator *pass back* the form bean object if a validation
fails? Or does it pass back only the errors?

My scenario is as follows. I have a page for creating a "Service". I
enter all the data and submit it. Assume that the validation fails. In
this case, along with the error message, I should display the submitted
values so that the user can correct them and re-submit. But now, my
whole form is not getting displayed because I am not getting the form
bean back. Any thing I am missing? **Must the form bean be in session
scope if I want this functionality?**

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Struts Validator Problem

2003-01-17 Thread Suresh Addagalla
Hi,

I am facing a problem with Validator while doing client-side validation.

IE is throwing the following error dialog when I submit the form:

"type" is null or not an object

The corresponding source code (validator generated) line the *second*
line below:

for (x in oRequired) {
if ((form[oRequired[x][0]].type == 'text' ||
 form[oRequired[x][0]].type == 'textarea' ||
 form[oRequired[x][0]].type == 'select-one' ||
 form[oRequired[x][0]].type == 'radio' ||
 form[oRequired[x][0]].type == 'password') &&
(form[oRequired[x][0]].value == '')) {

Please let me know if anyone knows how to fix this problem.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: [OT] Date format

2003-01-17 Thread Andrew Hill
Ok. This is wierd. I posted this in the morning - now its 11pm and it only
just arrived. Maybe I should have used snail mail!

Ah of course - its Friday. Guess the email server is taking it easy... ;-)

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 January 2003 11:41
To: Struts Users Mailing List
Subject: RE: [OT] Date format


Your best bet is to use the static factory methods in the DateFormat class.

ie:
Locale locale = getLocale(request); //Use struts Action method to get locale

dateTimeFormat =
ateFormat.getDateTimeInstance( DateFormat.SHORT,DateFormat.SHORT, locale);
dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale);
timeFormat = DateFormat.getTimeInstance( DateFormat.SHORT, locale);

Its all in the javadocs you know. :-)


In case you were wondering how the java.util.Date.toString() works, heres
its source code:

public String toString() {
DateFormat formatter = null;
if (simpleFormatter != null) {
formatter = (DateFormat)simpleFormatter.get();
}
if (formatter == null) {
/* No cache yet, or cached formatter GC'd */
formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz ",
 Locale.US);
simpleFormatter = new SoftReference(formatter);
}
synchronized (formatter) {
formatter.setTimeZone(TimeZone.getDefault());
return formatter.format(this);
}
}


-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 16 January 2003 22:56
To: [EMAIL PROTECTED]
Subject: Date format


Hi,

Please excuse me for the off-topic question, I need this urgently, so
posting it.

How can I get the current date format? (style: DateFormat.SHORT, locale:
Default)

I used:

SimpleDateFormat formatter = new SimpleDateFormat() ;
String format = formatter.toPattern() ;

It gives:

M/d/yy hh:mm a

But what I want is *only* the date part, excluding the time part of it.

Thanks,
Suresh



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Pasar atributos a un

2003-01-17 Thread Andrew Hill
Maaf... Saya tidak mengerti apa yang bicara... :-(

-Original Message-
From: Míguel Ángel Mulero Martínez
[mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 January 2003 17:20
To: Lista Struts
Subject: Pasar atributos a un 


Hola a todos,
Estoy usando la linea:


para almacenar en la variable text el contenido de la pagina despues de ser
ejecutado. Mi problema es que tengo un bean en la pagina actual que no es
visible para la pagina incluida, por lo tanto quiero pasarselo. ¿Hay alguna
forma de hacer esto? Al estilo del .

Gracias a todos,
Miguel


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: java.lang.String question disguised as an ActionForm question

2003-01-17 Thread Mark Galbreath
That's pretty curious; I would never have thought to do this, and wonder why
you are.  Anyway, it seems pretty obvious that s1 ==  + null
and s1 != null, so it fails the s1 == null test.  You, of course, cannot see
the System.out.println of an empty String, with or without a null
concatenated.

Mark

-Original Message-
From: Jagdish Arora [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 3:31 AM

ok, though this problem came up dealing with ActionForms, I completely
understand that this is a fundamental Java question, nothing more, so I will
pose it as that only.  Also, I am prepared for taking some
thisQuestion(OrYou)DoesntDeserveToBeHere flak:

String s1 = "" + null;
System.out.println ("s1: " + s1);
if (s1 == null)
System.out.println ("s1 is null");
else
System.out.println ("s1 is not null");

produces output:
s1: null
s1 is not null

While if I replace the first line by, String s1 = "";
then it produces output:
s1:
s1 is not null

(which I have no problem with).

Question: Why does the 1st line of the output of the first case read s1:
null  ?

Amrinder

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem with using DynaValidatorForm, is it possible to doit ??

2003-01-17 Thread Raible, Matt
http://www.mail-archive.com/struts-dev%40jakarta.apache.org/msg12356.html

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 5:34 PM
To: [EMAIL PROTECTED]
Subject: Problem with using DynaValidatorForm, is it possible to do it??


Hi,
I am trying to do the following and i get null pointer
exception,
DynaValidatorForm   PL1820UpdateForm = new
DynaValidatorForm();
PL1820UpdateForm.set("input1",  "This is test");

And my form definiation in struts-config is





The error i get it following
java.lang.NullPointerException
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:
551)
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:365)
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
com.pfizer.maps.action.sop.PL1820DispatchAction.getData(PL1820DispatchAction
.java:197)
[1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
at
com.pfizer.maps.action.sop.PL1820DispatchAction.change(PL1820DispatchAction.
java:145)

Need help






=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem with using DynaValidatorForm, is it possible to do it??

2003-01-17 Thread James Turner
Your main problem is that simply naming the variable the same as the
form Bean name isn't going to create the correct instantiation of the
form.  You're basically creating a "vanilla" uninitialized
DynaValidatorForm and then trying to set it's properties, but it doesn't
have any.

The "official" way to instantiate a DynaForm bean in struts is to have
it be the input form for an action, which will cause it to be
automatically instantiated.  Sometimes this can mean chaining through an
extra action just to instantiate a new form bean, especially in the
cases where you are processing one form, and then prepopulating another.

James

> -Original Message-
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 16, 2003 7:34 PM
> To: [EMAIL PROTECTED]
> Subject: Problem with using DynaValidatorForm, is it possible 
> to do it??
> 
> 
> Hi,
> I am trying to do the following and i get null pointer exception,
> DynaValidatorForm   PL1820UpdateForm = new
> DynaValidatorForm();
> PL1820UpdateForm.set("input1",  "This is test");
> 
> And my form definiation in struts-config is
> 
>  type="org.apache.struts.validator.DynaValidatorForm">
>  />
> 
> 
> The error i get it following
> java.lang.NullPointerException
> [1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
> at
> org.apache.struts.action.DynaActionForm.getDynaProperty(DynaAc
> tionForm.java:551)
> [1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
> at
> org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:365)
> [1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
> at
> com.pfizer.maps.action.sop.PL1820DispatchAction.getData(PL1820
> DispatchAction.java:197)
> [1/16/03 19:30:24:908 EST] 311dffa9 SystemErr R 
> at
> com.pfizer.maps.action.sop.PL1820DispatchAction.change(PL1820D
> ispatchAction.java:145)
> 
> Need help
> 
> 
> 
> 
> 
> 
> =
> A$HI$H
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread James Mitchell
I keep a couple of links on my home page:

http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=microsoft+javascr
ipt+debugger&btnG=Google+Search


--
James Mitchell





- Original Message -
From: "João Paulo Batistella" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 8:30 AM
Subject: Off-Topic: Microsoft Javascript Debugger


> Please, where can I download the Microsoft Javascript
> Debugging Tool to use with Internet Explorer?
>
> Thanks,
> Joao Paulo.
>
> ___
> Busca Yahoo!
> O melhor lugar para encontrar tudo o que você procura na Internet
> http://br.busca.yahoo.com/
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [OT] Date format

2003-01-17 Thread Andrew Hill
DateFormat is an abstract class of which SimpleDateFormat is a subclass.

When you call getDateInstance() what you get back is actually a
SimpleDateFormat - however I am under the distinct impression this depends
on the locale. Some locales could in theory give back something different
again or if the implementation of the factory methods changes in a future
JVM maybe it wouldnt use SimpleDateFormat?

You could do an instanceof to check if its a SimpleDateFormat and proceed
from there - of course for those locales that dont use SimpleDateFormat then
AFAIK you wont be able to get the pattern - this is because pattern is a
SimpleDateFormat feature and not a DateFormat thing so if it isnt a
SimpleDateFormat (or subclass of SimpleDateFormat) then there isnt a pattern
you can make use of anyway! (I could be wrong on that)

Out of curiosity I tried the following:
Locale[] locales = Locale.getAvailableLocales();
System.out.println("numLocales=" + locales.length);
for(int i=0; i < locales.length; i++)
{
  Locale locale = locales[i];
  DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, locale);
  String klass = df.getClass().getName();
  if(!("java.text.SimpleDateFormat".equals(klass)))
  {
System.out.println("class for locale" + locale + " is " +
df.getClass().getName() );
  }
}

It reported 145 available locales on my JVM. ALL of them used
SimpleDateFormat.
(But you cant rely on that - and in general its not considered good practice
to make assumptions about which implementation class you get back for a
factory method that returns a superclass or interface...)

Sorry I cant be of more help :-(

-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 January 2003 22:42
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: [OT] Date format


Hi,

What I am looking for is how to display the *format*, and not how to
display a date in a given format. So, there doesn't seem to be anything
provided with the API.

I need a method like "toPattern()" of SimpleDateFormat in the DateFormat
class because getDateInstance() returns me DateFormat and not
SimpleDateFormat.

Suresh

>-Original Message-
>From: Andrew Hill [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 17, 2003 9:11 AM
>To: Struts Users Mailing List
>Subject: RE: [OT] Date format
>
>
>Your best bet is to use the static factory methods in the
>DateFormat class.
>
>ie:
>Locale locale = getLocale(request); //Use struts Action method
>to get locale
>
>dateTimeFormat =
>ateFormat.getDateTimeInstance( 
>DateFormat.SHORT,DateFormat.SHORT, locale);
>dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale);
>timeFormat = DateFormat.getTimeInstance( DateFormat.SHORT, locale);
>
>Its all in the javadocs you know. :-)
>
>
>In case you were wondering how the java.util.Date.toString() 
>works, heres
>its source code:
>
>public String toString() {
>   DateFormat formatter = null;
>   if (simpleFormatter != null) {
>   formatter = (DateFormat)simpleFormatter.get();
>   }
>   if (formatter == null) {
>   /* No cache yet, or cached formatter GC'd */
>   formatter = new SimpleDateFormat("EEE MMM dd 
>HH:mm:ss zzz ",
>Locale.US);
>   simpleFormatter = new SoftReference(formatter);
>   }
>synchronized (formatter) {
>formatter.setTimeZone(TimeZone.getDefault());
>return formatter.format(this);
>}
>}
>
>
>-Original Message-
>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, 16 January 2003 22:56
>To: [EMAIL PROTECTED]
>Subject: Date format
>
>
>Hi,
>
>Please excuse me for the off-topic question, I need this urgently, so
>posting it.
>
>How can I get the current date format? (style: 
>DateFormat.SHORT, locale:
>Default)
>
>I used:
>
>SimpleDateFormat formatter = new SimpleDateFormat() ;
>String format = formatter.toPatte
rn() ;
>
>It gives:
>
>M/d/yy hh:mm a
>
>But what I want is *only* the date part, excluding the time part of it.
>
>Thanks,
>Suresh



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Modules

2003-01-17 Thread James Mitchell
I keep these since some don't like to search the archives



--
On Tue, 19 Nov 2002, Emmanuel Boudrant wrote:

> Date: Tue, 19 Nov 2002 13:48:44 +0100 (CET)
> From: Emmanuel Boudrant <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Does the /do/* will be supported with modules
>
> Hi,
>
> Actually the /do/* path mapped pattern doesn't work fine with modules,
> does this pattern will work
>
> with final release
>

At the moment, it appears that the restriction that extension mapping must
be used for application modules will remain in the final release.  Two
things would be necessary to change this:

* Someone would have to come up with a strategy that resovles
  the problem of how to define path-mapped URLs that still
  include the module prefix in some reasonable fashion that can
  be parsed.

* Someone would have to implement this strategy.

> ...And, is it a good advice to use /do/* instead of *.do
>

For a non-module scenario, this is pretty much a cosmetics issue --
whichever style creates URLs that you like better is the one you should
use.

> Thanx,
> -emmanuel
>

Craig
--




--
James Mitchell





- Original Message -
From: "Mark McBride" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 7:38 PM
Subject: Re: Struts Modules


I tripped up on this also ... is there a reason why Pre-fix matching
("/do/*") does not work with the multiple application configuration?

Are there plans on supporting pre-fix matching in the future?

Thanks in advance!

-Mark
At 04:20 PM 1/16/2003 +0100, you wrote:
>2003. január 16. 16:11 dátummal Christoph Rooms ezt írtad:
> > Hi,
> >
> > I have my Action Servlet  to react with the servlet mapping "/do/*".
> >
> > I have the feeling this does not work when I am using Struts Modules.
> > Anyone who got modules working with this servlet mapping ?
>
>http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_map
ping
>
>Last sentence in the paragraph in RED.
>
>Hth,
>
>Tib
>
>--
>To unsubscribe, e-mail:

>For additional commands, e-mail:






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [OT]: I don't see how this works?

2003-01-17 Thread Durham David Cntr 805CSS/SCBE
That will sort whatever is inside of lActions base on the anonymous comparator object. 
 Check here for details on the Comparator interface, 
http://java.sun.com/j2se/1.4/docs/api/java/util/Comparator.html





> -Original Message-
> From: Simon Kelly [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 4:22 AM
> To: Struts Users Mailing List
> Subject: [OT]: I don't see how this works?
> 
> 
> I'm just scanning thru the struts source, looking for 
> ModuleConfig stuff and
> ran over this bit of code.
> 
> I've never seen anything written like it and wondered what 
> it's doing and
> how the hell does it work?
> 
> Cheers
> 
> Simon
> 
> 
> Collections.sort(lActions, new Comparator() {
> public int compare(Object o1, Object o2) {
> ValidatorAction va1 = (ValidatorAction) o1;
> ValidatorAction va2 = (ValidatorAction) o2;
> if ((va1.getDepends() == null || va1.getDepends().length() == 0)
> && (va2.getDepends() == null || va2.getDepends().length() == 0)) {
> return 0;
> } else if (
> (va1.getDepends() != null && va1.getDepends().length() > 0)
> && (va2.getDepends() == null || va2.getDepends().length() == 0)) {
> return 1;
> } else if (
> (va1.getDepends() == null || va1.getDepends().length() == 0)
> && (va2.getDepends() != null && va2.getDepends().length() > 0)) {
> return -1;
> } else {
> return va1.getDependencies().size() - va2.getDependencies().size();
> }
> }
> });
> Institut fuer
> Prozessdatenverarbeitung
> und Elektronik,
> Forschungszentrum Karlsruhe GmbH,
> Postfach 3640,
> D-76021 Karlsruhe,
> Germany.
> 
> Tel: (+49)/7247 82-4042
> E-mail : [EMAIL PROTECTED]
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator and Form Bean

2003-01-17 Thread Rick Reumann
On Friday, January 17, 2003, 8:42:11 AM, Suresh wrote:

SA> But now, my whole form is not getting displayed because I am not
SA> getting the form bean back. Any thing I am missing? **Must the
SA> form bean be in session scope if I want this functionality?**

No, the FormBean can have request scope. How are you setting up the
form bean into the page initially? Are you sure you are setting it up
correctly in the struts-config.xml file? Maybe you could paste that
part of the code here.


-- 

Rick
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: regular expression help

2003-01-17 Thread Durham David Cntr 805CSS/SCBE
I don't understand what you're asking, so I'll take a guess.  If you're looking for an 
escape senquence so that you can look for +'s and -'s  then try putting a \ in front 
of them, e.g., \+ and \-.

> -Original Message-
> From: Raible, Matt [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 8:04 AM
> To: '[EMAIL PROTECTED]'
> Subject: regular expression help
> 
> 
> Anyone know a good regular expression translator - or the 
> equivalent of
> allowing "+", "-" or " "?
> 
> Thanks,
> 
> Matt
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread Jerry Jalenak
I can never find the script debugger on M$ website, so I made sure I keep a
download of it


Jerry

> -Original Message-
> From: James Childers [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 8:27 AM
> To: Struts Users Mailing List
> Subject: RE: Off-Topic: Microsoft Javascript Debugger
> 
> 
> 
> > Please, where can I download the Microsoft Javascript
> > Debugging Tool to use with Internet Explorer?
> > 
> > Thanks,
> > Joao Paulo.
> > 
> 
> I don't know about that, but Mozilla comes with a pretty good 
> JavaScript debugger ("Venkman") built in. It appears to be 
> more robust than the MS JavaScript debugger, although I'm not 
> entirely sure about this because I haven't gotten very good 
> with it yet. :)
> 
> -= J
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 


This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at the following email 
address: [EMAIL PROTECTED]


   McAfee GroupShield for Microsoft Exchange**
**

Alert generated on: Friday, January 17, 2003 09:16:57 AM Central Standard Time


The file scd10en.exe has been replaced. Reason: The file met the blocking options set 
in the anti-virus system.
Please consult your administrator for further help quoting your ticket number: 
OA245_1042816617_MAIL_3

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: regular expression help

2003-01-17 Thread Jarnot Voytek Contr AU HQ/SC
how about (\+|\-|\s)

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:04 AM
To: '[EMAIL PROTECTED]'
Subject: regular expression help


Anyone know a good regular expression translator - or the equivalent of
allowing "+", "-" or " "?

Thanks,

Matt


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Validator and Form Bean

2003-01-17 Thread Suresh Addagalla
Yeah, I seem to be setting up struts-config correctly as it works fine
if I change the scope to "session". Here is the config:

Form-bean related config:










Action mapping related config:






 


Thanks,
Suresh

>-Original Message-
>From: Rick Reumann [mailto:[EMAIL PROTECTED]] 
>Sent: Friday, January 17, 2003 8:44 PM
>To: Struts Users Mailing List; [EMAIL PROTECTED]
>Subject: Re: Validator and Form Bean
>
>
>On Friday, January 17, 2003, 8:42:11 AM, Suresh wrote:
>
>SA> But now, my whole form is not getting displayed because I am not
>SA> getting the form bean back. Any thing I am missing? **Must the
>SA> form bean be in session scope if I want this functionality?**
>
>No, the FormBean can have request scope. How are you setting up the
>form bean into the page initially? Are you sure you are setting it up
>correctly in the struts-config.xml file? Maybe you could paste that
>part of the code here.
>
>
>-- 
>
>Rick
>mailto:[EMAIL PROTECTED]
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validators: same rule for differents fields forms

2003-01-17 Thread Jean-Pierre Romeyer
How to have a single rule described once  (no duplicated code) and use it 
in differents fields or differents forms
whitout writting a java custom validator : described in a declarative way 
as validation.xml 

Thanks



RE: [Ignore this mail]

2003-01-17 Thread Chen, Gin
okay i'm ignoring it

-Original Message-
From: Simon Kelly [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 9:38 AM
To: Struts Users Mailing List
Subject: [Ignore this mail]



Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]

--
To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread James Mitchell
http://msdn.microsoft.com/library/en-us/sdbug/Html/sdbug_1.asp



--
James Mitchell





- Original Message -
From: "Mark Galbreath" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 9:38 AM
Subject: RE: Off-Topic: Microsoft Javascript Debugger


There's no such thing.  You are thinking of the M$ VBScript debugger, which
comes with (at least) IE 6.0.  If you use Navigator, entering
"about:javascript" in the location field will return error messages.

Mark

-Original Message-
From: João Paulo Batistella [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:30 AM


Please, where can I download the Microsoft Javascript
Debugging Tool to use with Internet Explorer?



--
To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Most Stable Struts Build

2003-01-17 Thread Vinh Tran
All:

I am finally updating Tomcat to 4.0 and I would like to also update Struts
to 1.1 as well.  I was wondering if anyone has a recommendation on which
build of Struts 1.1 is the most stable.  I will be utilizing the
following...

Tomcat 4.0
Tiles
Validator
Digester
Struts-EL/JSTL


Thanks.  Vinh.



RE: The best way for learning struts (stupid question)

2003-01-17 Thread Edgar Dollin
I would add, learning a java based IDE, eclipse is a good one, and logging
(or do you count that as part of learning the container?).

Edgar



-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 1:57 AM
To: 'Struts Users Mailing List'
Subject: Re: The best way for learning struts (stupid question)




On Thu, 16 Jan 2003, joni santoso wrote:

> Date: Thu, 16 Jan 2003 11:33:21 +0700
> From: joni santoso <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: The best way for learning struts (stupid question)
>
> Hi,
>
> Now, I can already make struts read the new setting
> changes without resetting Tomcat.
>
> My question is now : what should I learn first? what
> should I master? As I see there are "too many" concepts
> and technical terms
>

When I'm learning something new, I have always preferred to go "bottom
up".  For a prospective Struts developer, that probably means starting at
the appropriate point (for you) on the following list, depending on what
you're already familiar with:

* Fundamentals of object-oriented programming

* Java as a programming language

* Design patterns (at the programming level)

* Unit testing concepts and test-first design (JUnit is a wonderful
  tool for this in the Java space)

* Basics of relational databases, SQL, and the
  corresponding Java API (JDBC).

* Fundamentals of XML and XSLT (if you're going to be doing
  web services or XML-heavy applications)

* Architecture of the web (particularly how HTTP, HTML, and
  JavaScript work)

* The Servlet API -- foundation to every Java-based web application

* Basics of the view-layer technology (such as JSP) you plan to use
  If you're planning to use JSPs, plan on spending some time on:
  - Custom tags
  - JSTL 1.0 and the expression language

* Design patterns (at the architectural level)

* Implementations of the design patterns you plan to use
  (i.e. Struts as an implementation of the MVC design pattern)

* Use of advanced Struts features and extensions

The above list presumes you are going to be responsible for the entire
application.  In larger-scale environments there tend to be folks that
specialize on the various layers or tiers (persistent data storage,
business logic, presentation logic) -- if that is the place you are at,
you should spend more time on the technologies relevant to that specialty.

In all cases, there are an abundance of articles, tutorials, and books
around - the Struts resources pages include at least some starting points
for many of these areas.  To find more, "Google is your friend" :-).

Yes, that list is very long.  But the rewards for persevering and becoming
an expert are very great :-).

Craig


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: regular expression help

2003-01-17 Thread Mark Galbreath
Are you using J2SE 1.4?  Write one: java.util.regex.Matcher.  Then
distribute it to us!

Mark

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 9:04 AM

Anyone know a good regular expression translator - or the equivalent of
allowing "+", "-" or " "?



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: java.lang.String question disguised as an ActionForm question

2003-01-17 Thread Jarnot Voytek Contr AU HQ/SC
"" + null ends up being "null" just as "" + 1 would end up as "1".  Remember
that Java will allow you to add anything to a String, it does the conversion
for you - that's why Object has a toString() method.

I am also very curious why one would ever need to write
String s1 = "" + null;

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:50 AM
To: 'Struts Users Mailing List'
Subject: RE: java.lang.String question disguised as an ActionForm
question


That's pretty curious; I would never have thought to do this, and wonder why
you are.  Anyway, it seems pretty obvious that s1 ==  + null
and s1 != null, so it fails the s1 == null test.  You, of course, cannot see
the System.out.println of an empty String, with or without a null
concatenated.

Mark

-Original Message-
From: Jagdish Arora [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 3:31 AM

ok, though this problem came up dealing with ActionForms, I completely
understand that this is a fundamental Java question, nothing more, so I will
pose it as that only.  Also, I am prepared for taking some
thisQuestion(OrYou)DoesntDeserveToBeHere flak:

String s1 = "" + null;
System.out.println ("s1: " + s1);
if (s1 == null)
System.out.println ("s1 is null");
else
System.out.println ("s1 is not null");

produces output:
s1: null
s1 is not null

While if I replace the first line by, String s1 = "";
then it produces output:
s1:
s1 is not null

(which I have no problem with).

Question: Why does the 1st line of the output of the first case read s1:
null  ?

Amrinder

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Display values after validation (was RE: action input)

2003-01-17 Thread Susan Bradeen
Yep, works fine. Quite impressive, saves some work. I ended up having an 
issue with a custom "record lock" when trying to fetch information for 
editing a second time. Not a Struts issue! 

Thank you to all who replied.

Susan Bradeen





"Mark Galbreath" <[EMAIL PROTECTED]>
01/17/2003 09:32 AM
Please respond to "Struts Users Mailing List"

 
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc: 
Subject:RE: Display values after validation (was RE: action input)


Like I said, "Try it and see."  I've never tried it, and apparently no one
else here has either.  Let us know how it turns out.

Mark

-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 8:23 AM


But by using an action path for input instead of a JSP, isn't the 
ActionForm reset, so you no longer have your form values to show in the 
JSP again? How do you redisplay the incorrect values the user typed into 
the JSP? 

Susan Bradeen

On 01/16/2003 03:22:14 PM "Mark Galbreath" wrote:

> Try it and see.
> 
> input is the application-relative path to the input form to which
control
> should be returned if a validation error is encountered and you have 
> to specify the name attribute of the form bean associated with the 
> action.
> 
> Mark
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: action input
> 
> 
>  input="mypage.jsp">
> 
> 
> 
> Can I set input="myAction2.do"?
> 
> 
> 
> Regards,
> 
> 
> 
> 
> 
> 
> 
> PQ
> 
> 
> 
> "This Guy Thinks He Knows Everything"
> 
> "This Guy Thinks He Knows What He Is Doing"
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

> 

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Axis/SOAP proposal for Struts

2003-01-17 Thread Mike Oliver
Struts Users, 

 

I would like to propose that Struts be extended to support another entry
point.  The ActionServlet would be augmented by an Axis/SOAP Web
Services Interface to Struts.  FormBeans would be part of the payload
for requests.  Responses would be generated by Forwards for SOAP.  This
new Axis entry point would do the same work as ActionServlet with the
only significant difference being the construction of the FormBean.
Incoming SOAP Requests would be configured to call the same
RequestHandlers and as far as the actions go they won't know that the
source was an HTML Form or a serialized FormBean.  

 

I feel this will give a great deal of flexibility to Applications where
they want a Web Browser User Interface as well as Web Services for the
same Application Data Model and Business Logic.

 

I am planning on doing this anyway, and felt it applicable to this group
and would offer to share it as a sub project and would welcome
contributions of thought, expertise and code.

 

Michael Oliver
Chief Technology Officer
AppsAsPeers LLC
7391 S. Bullrider Ave.
Tucson, AZ 85747
520.574.1150 Voice
520.844.1036 Fax
520.270.8862 Cell
http://www.appsaspeers.com   Home Page
[EMAIL PROTECTED] SMS
http://www.ollie.ezpeer.net   Personal
Home Page
http://www.ollie.im-live.com/im-live/  Instant Chat
[EMAIL PROTECTED] MSN Messenger
[EMAIL PROTECTED] Yahoo Instant Messenger
MikeOliverAZ Aol Instant Messenger



 




Re: [OT] Date format

2003-01-17 Thread Mark Lepkowski
RE: [OT] Date formatWith SimpleDateFormat you specify the format as a String.  You 
surely should be able to display that string.
  What I am looking for is how to display the *format*, and not how to 
  display a date in a given format. (snip)




Re: Most Stable Struts Build

2003-01-17 Thread David Graham
1.1 beta 3







From: "Vinh Tran" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Most Stable Struts Build
Date: Fri, 17 Jan 2003 10:37:15 -0500

All:

I am finally updating Tomcat to 4.0 and I would like to also update Struts
to 1.1 as well.  I was wondering if anyone has a recommendation on which
build of Struts 1.1 is the most stable.  I will be utilizing the
following...

Tomcat 4.0
Tiles
Validator
Digester
Struts-EL/JSTL


Thanks.  Vinh.



_
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Tiles - Modules - HTML:BASE

2003-01-17 Thread Christoph Rooms
Hi guys,

I am trying to replace the Templates by Tiles ... 

The problem I am facing is, that the html:base tag is based on the
location of my layout-file. (in my case /layout ...) So all my images
now point to  ... /context/layouts/images/mg1.jpg, it should be
/context/images/img1.jpg ... 

Is there a solution for this  ?

thanks, Christoph

Christoph Rooms
TAM
+ 32 475 531 529

Novell Positioned as a "Leader" in Analyst Firm's Metadirectory Magic
Quadrant 
Novell is the first, and thus far only, company to enter the Leader
Quadrant of Gartner's Metadirectory Services Magic Quadrant. Leaders are
vendors who are performing well today, have a clear vision of market
direction, and are actively building competencies to sustain their
leadership position in the market. Read more and find out how to access
the report at www.novell.com/news/press/archive/2002/08/pr02058.html


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator Problem

2003-01-17 Thread Dan Tran
check your validation.xml and makesure all dedined form field match with
your jsp field.  I ran to this before

hope this help

-D

- Original Message -
From: "Suresh Addagalla" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 6:42 AM
Subject: Struts Validator Problem


> Hi,
>
> I am facing a problem with Validator while doing client-side validation.
>
> IE is throwing the following error dialog when I submit the form:
>
> "type" is null or not an object
>
> The corresponding source code (validator generated) line the *second*
> line below:
>
> for (x in oRequired) {
> if ((form[oRequired[x][0]].type == 'text' ||
>  form[oRequired[x][0]].type == 'textarea' ||
>  form[oRequired[x][0]].type == 'select-one' ||
>  form[oRequired[x][0]].type == 'radio' ||
>  form[oRequired[x][0]].type == 'password') &&
> (form[oRequired[x][0]].value == '')) {
>
> Please let me know if anyone knows how to fix this problem.
>
> Thanks,
> Suresh
>
>






> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Axis/SOAP proposal for Struts

2003-01-17 Thread Mark Galbreath
I actually AM doing this now, but I whole-heartedly agree that a
standardized Axis/SOAP interface to Struts would be very, very cool.

Mark

-Original Message-
From: Mike Oliver [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 10:46 AM

I would like to propose that Struts be extended to support another entry
point.  The ActionServlet would be augmented by an Axis/SOAP Web Services
Interface to Struts.  FormBeans would be part of the payload for requests.
Responses would be generated by Forwards for SOAP.  This new Axis entry
point would do the same work as ActionServlet with the only significant
difference being the construction of the FormBean. Incoming SOAP Requests
would be configured to call the same RequestHandlers and as far as the
actions go they won't know that the source was an HTML Form or a serialized
FormBean.  

I feel this will give a great deal of flexibility to Applications where they
want a Web Browser User Interface as well as Web Services for the same
Application Data Model and Business Logic.

I am planning on doing this anyway, and felt it applicable to this group and
would offer to share it as a sub project and would welcome contributions of
thought, expertise and code.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




DAO and Struts Best Practice

2003-01-17 Thread Phase Web and Multimedia
My struts app access my resource layer via a DAO pattern. I have been using
DAO for a while and have seen various manners in which this is implemented.
I have some questions for all of you out there in regards to the DAO pattern
that you use and why. Following are some comparison points between a few
patterns. What in your opinion are the pluses and minuses

Below I describe a few DAO patterns. If you have others feel free to append
them:

Static Method DAO Pattern:
- class is not instantiated
- class use static methods
- class contains multiple methods
- each method contains it's own connection instantiation and destruction
- parameters needed to perform each method's operation's are passed into the
method

Instantiated DAO with Method parameters: (* This is the pattern I use)
- class is instantiated
- class methods are NOT static
- class contains multiple methods
- connection is a setter/getter and is shared among all methods during the
life of the instantiated class object
- parameters needed to perform each method's operations are passed into the
method (no setters/getters)

Instantiated DAO Bean Pattern:
- class is instantiated
- class methods are NOT static
- class contains multiple methods
- connection is a setter/getter and is shared among all methods during the
life of the instantiated class object
- parameters needed to perform each method's operations are held on the
class level as members of the class. They are altered with setters/getters.
Each method receives no parameters.

The one method DAO:
This pattern can be applied to all of the above. Essentially every class
contains only one method that accomplishes a specific function.

I use the second pattern simply because during development I can see what
parameters my method needs to perform it's funtion and make sure they are
passed in. If I try to compile without providing the proper parameters the
compile fails and I know my error before I start testing the class. It's
simply a development things... easier javadoc and code completion as well.
But, there have been times when I questioned the amount of parameters being
passed into the method, but, rarely. My pattern does not easily lend itself
to using tools like BeanUtils to perform property copying from one bean to
another.

So, what are your thoughts.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: regular expression help

2003-01-17 Thread Raible, Matt
Sounds like it's work, I'm trying to create a constant for the validator -
where a field can only have +, - or " "

  
zip
^\d{5}\d*$
  


-Original Message-
From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:14 AM
To: 'Struts Users Mailing List'
Subject: RE: regular expression help


how about (\+|\-|\s)

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:04 AM
To: '[EMAIL PROTECTED]'
Subject: regular expression help


Anyone know a good regular expression translator - or the equivalent of
allowing "+", "-" or " "?

Thanks,

Matt


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Off-Topic: Microsoft Javascript Debugger

2003-01-17 Thread Mark Galbreath
Like I said, LISP boy:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdbug/Html/
sdbug_2.asp

VBScript, not JavaScript.

Mark

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 10:25 AM


http://msdn.microsoft.com/library/en-us/sdbug/Html/sdbug_1.asp


- Original Message -
From: "Mark Galbreath" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 9:38 AM
Subject: RE: Off-Topic: Microsoft Javascript Debugger


There's no such thing.  You are thinking of the M$ VBScript debugger, which
comes with (at least) IE 6.0.  If you use Navigator, entering
"about:javascript" in the location field will return error messages.

Mark

-Original Message-
From: João Paulo Batistella [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:30 AM


Please, where can I download the Microsoft Javascript
Debugging Tool to use with Internet Explorer?



--
To unsubscribe, e-mail: 
For additional commands, e-mail:





--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Indexed Properties and Population

2003-01-17 Thread Raible, Matt
Here's how I did it:

On my Form:

public ArrayList getKids() {
returns kids;
}

public void setKids(ArrayList kids) {
this.kids = kids;
}

public int getKidsSize() {
return kids.size();
}

In my JSP:


...

...



On my form (relevant for saving)

public void reset(ActionMapping mapping, HttpServletRequest request) {
// make the kids ArrayList the proper size and populate with
// empty objects
int kidsSize = Integer.parseInt(request.getParameter("kidsSize"));
kids = new ArrayList(kidsSize);
for (int i=0; i < kidsSize; i++) {
kids.add(new KidForm());
}
}

This seems to work great for me.  Any other suggestions/methods are
encouraged ;)  Is it lunchtime (beertime) yet?

HTH,

Matt

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 6:52 AM
To: Struts Users Mailing List
Subject: Re: Indexed Properties and Population



David says:
"One implementation that should work based on your example
as long as you are willing to create a child factory is in the commons
collection package and is ListUtils.lazyList, which takes a List and
factory."

I have used this as well, in combination with the nested tag library.
We have  a page that displays and updates a List of Value Objects where
each have two internal Lists of Value Objects.
The structure of value objects are sent to me from the back end as such:

CustomerList
  CustomerVo 1
creditVo1   invoiceVo1
creditVo2   invoiceVo2
.   .

  CustomerVo2
creditVo1   invoiceVo1
creditVo2   invoiceVo2
.   .


I would be curious to know  this would done without the nested tags and
lazy list.








"David Morris" <[EMAIL PROTECTED]> on 01/16/2003 03:50:10 PM

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

To:<[EMAIL PROTECTED]>
cc:

Subject:Re: Indexed Properties and Population


Matt,

You really don't need to know how many there are, just create them
on demand. You can intercept gets and auto-extend the underlying
Collection. One implementation that should work based on your example
as long as you are willing to create a child factory is in the commons

collection package and is ListUtils.lazyList, which takes a List and
factory.

David Morris

>>> [EMAIL PROTECTED] 01/16/03 02:31PM >>>
I have an ArrayList on a form... let's call the form Parent and the
ArrayList Children.

If I have:

private ArrayList children;

public void setChildren(int index, ChildForm childForm) {
 this.children.set(index, childForm);
}

Then saving my form results in a NPE for BeanUtils.copyProperties.  If
I
create a whole bunch of objects in the ArrayList in the constructor -
I
avoid this problem:

public ParentForm () {
children = new ArrayList(100);
for (int i=0; i < 100; i++) {
children.add(new ChildForm());
}

But I'm guessing that this fits better into the reset(mapping,
request)
method of my form.  My question is - how do I determine how many there
are?
Is there something in the request this this information - or should I
set a
hidden field with the number of children?

Thanks,

Matt

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








--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Most Stable Struts Build

2003-01-17 Thread Mark Galbreath
When is the next release coming out?

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 11:01 AM

1.1 beta 3



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Tiles - Modules - HTML:BASE

2003-01-17 Thread Raible, Matt
I have found that I'm better off not using the  tag with Tiles.

-Original Message-
From: Christoph Rooms [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 9:01 AM
To: [EMAIL PROTECTED]
Subject: Tiles - Modules - HTML:BASE


Hi guys,

I am trying to replace the Templates by Tiles ... 

The problem I am facing is, that the html:base tag is based on the
location of my layout-file. (in my case /layout ...) So all my images
now point to  ... /context/layouts/images/mg1.jpg, it should be
/context/images/img1.jpg ... 

Is there a solution for this  ?

thanks, Christoph

Christoph Rooms
TAM
+ 32 475 531 529

Novell Positioned as a "Leader" in Analyst Firm's Metadirectory Magic
Quadrant 
Novell is the first, and thus far only, company to enter the Leader
Quadrant of Gartner's Metadirectory Services Magic Quadrant. Leaders are
vendors who are performing well today, have a clear vision of market
direction, and are actively building competencies to sustain their
leadership position in the market. Read more and find out how to access
the report at www.novell.com/news/press/archive/2002/08/pr02058.html


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Tiles - Modules - HTML:BASE

2003-01-17 Thread Pani, Gourav
The  tag also causes problems with links where you have to
implicitly specify the application root as part of your directory path in
your JSPs.

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:08 AM
To: 'Struts Users Mailing List'
Subject: RE: Tiles - Modules - HTML:BASE


I have found that I'm better off not using the  tag with Tiles.

-Original Message-
From: Christoph Rooms [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 9:01 AM
To: [EMAIL PROTECTED]
Subject: Tiles - Modules - HTML:BASE


Hi guys,

I am trying to replace the Templates by Tiles ... 

The problem I am facing is, that the html:base tag is based on the
location of my layout-file. (in my case /layout ...) So all my images
now point to  ... /context/layouts/images/mg1.jpg, it should be
/context/images/img1.jpg ... 

Is there a solution for this  ?

thanks, Christoph

Christoph Rooms
TAM
+ 32 475 531 529

Novell Positioned as a "Leader" in Analyst Firm's Metadirectory Magic
Quadrant 
Novell is the first, and thus far only, company to enter the Leader
Quadrant of Gartner's Metadirectory Services Magic Quadrant. Leaders are
vendors who are performing well today, have a clear vision of market
direction, and are actively building competencies to sustain their
leadership position in the market. Read more and find out how to access
the report at www.novell.com/news/press/archive/2002/08/pr02058.html


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Most Stable Struts Build

2003-01-17 Thread Nicolas De Loof
I think I allready read this question somewhere 

http://jakarta.apache.org/struts/faqs/helping.html#release

Nico.


> When is the next release coming out?
>
> -Original Message-
> From: David Graham [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 11:01 AM
>
> 1.1 beta 3
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Most Stable Struts Build

2003-01-17 Thread Mark Galbreath
Nico doesn't know me very well, do he?  ;-)

-Original Message-
From: Nicolas De Loof [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 11:12 AM


I think I allready read this question somewhere 

http://jakarta.apache.org/struts/faqs/helping.html#release

Nico.


> When is the next release coming out?
>
> -Original Message-
> From: David Graham [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 11:01 AM
>
> 1.1 beta 3
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Axis/SOAP proposal for Struts

2003-01-17 Thread Joe Germuska
I am planning on doing this anyway, and felt it applicable to this group
and would offer to share it as a sub project and would welcome
contributions of thought, expertise and code.


Craig has talked about a vision for Web Services being a part of 
Struts 2.x, although it doesn't seem to be on the "roadmap".

http://jakarta.apache.org/struts/status.html

I think a full release of 1.1 is the first priority, and then people 
seem ready to split into two streams.  But I suspect that Web 
Services properly belong in the 2.0 stream.

I'd be happy to hear why my suspicion is wrong...

Joe

--
--
Joe Germuska  | "Big corporations here now believe we 
will have war.
[EMAIL PROTECTED]  | Believe all would welcome it as relief to 
suspense."
http://blog.germuska.com/ | telegram to President McKinley, 25 March 1898


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: Most Stable Struts Build

2003-01-17 Thread David Graham
Sarcasm can be tough to get through email...I hope that was a joke ;-).

Dave







From: "Mark Galbreath" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: Most Stable Struts Build
Date: Fri, 17 Jan 2003 11:07:10 -0500

When is the next release coming out?

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:01 AM

1.1 beta 3



--
To unsubscribe, e-mail:   

For additional commands, e-mail: 



_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: Tiles - Modules - HTML:BASE

2003-01-17 Thread Christoph Rooms
What are possible alternatives ?

Christoph Rooms
TAM
+ 32 475 531 529

Novell Positioned as a "Leader" in Analyst Firm's Metadirectory Magic
Quadrant 
Novell is the first, and thus far only, company to enter the Leader
Quadrant of Gartner's Metadirectory Services Magic Quadrant. Leaders are
vendors who are performing well today, have a clear vision of market
direction, and are actively building competencies to sustain their
leadership position in the market. Read more and find out how to access
the report at www.novell.com/news/press/archive/2002/08/pr02058.html


>>> [EMAIL PROTECTED] 01/17/03 05:12pm >>>
The  tag also causes problems with links where you have to
implicitly specify the application root as part of your directory path
in
your JSPs.

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 11:08 AM
To: 'Struts Users Mailing List'
Subject: RE: Tiles - Modules - HTML:BASE

si
I have found that I'm better off not using the  tag with
Tiles.

-Original Message-
From: Christoph Rooms [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 9:01 AM
To: [EMAIL PROTECTED] 
Subject: Tiles - Modules - HTML:BASE


Hi guys,

I am trying to replace the Templates by Tiles ... 

The problem I am facing is, that the html:base tag is based on the
location of my layout-file. (in my case /layout ...) So all my images
now point to  ... /context/layouts/images/mg1.jpg, it should be
/context/images/img1.jpg ... 

Is there a solution for this  ?

thanks, Christoph

Christoph Rooms
TAM
+ 32 475 531 529

Novell Positioned as a "Leader" in Analyst Firm's Metadirectory Magic
Quadrant 
Novell is the first, and thus far only, company to enter the Leade
Quadrant of Gartner's Metadirectory Services Magic Quadrant. Leaders
are
vendors who are performing well today, have a clear vision of market
direction, and are actively building competencies to sustain their
leadership position in the market. Read more and find out how to
access
the report at www.novell.com/news/press/archive/2002/08/pr02058.html 


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:  

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




  1   2   3   >