RE: ??? STRUTS 1.2.4 FEEDBACK ???

2004-09-18 Thread David G. Friedman
Niall,

While researching (out of curiosity) a recent help request on how to use
custom ActionForwards with set-property, I actually read the
struts_config_1_2.tld and the ActionServlet class (from CVS). I found that
the tld describes how to set various init-params in web.xml for
ActionServlet which don't seem to exist anymore.  There are no references as
the tld comments describe in the 1.2.4 userGuide\configuration.xml or the
latest ActionServlet.java code. Maybe no one remembered it was an odd
comment in the 1.2 (v 1.8) tld?  Below are the 3 comment sections including
their seemingly obsolete notes on init params:







Regards,
David

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 12:16 AM
To: Struts Users Mailing List
Subject: ??? STRUTS 1.2.4 FEEDBACK ???


Has anyone tried out Struts 1.2.4?

If so can you feedback - positive or negative.

Niall



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


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



RE: CustomActionForward -- How do I pick it up in the Action?

2004-09-18 Thread David G. Friedman
John,

I've been playing around with your issue on 1.2.4 and it all worked
normally. (code examples and plenty of notes below)

I was able to set the global-forwards parameter "type" to my ActionForward
subclass.  I had to shut down Tomcat completely and start it clean to get
that to work. My ActionForward subclass contained a dump property name, yes,
"property" (i.e. getProperty()/setProperty(String)).  I was also able to set
the ActionForward subclass on an individual forward, both in the
global-forwards section and as a nested (inside the Action declaration)
forward using the className="someActionForwardSubclass" parameter.

There is a second way to globally override forwards in the web.xml by
specifying the "forward" init parameter to the ActionServlet but that DID
NOT work for me.  The notes that this should be possible are in the
struts-config_1_2.tld file:



There is nothing in the code.  It looks like the init params "debug",
"detail", and "forward", etc. are no longer valid init-params for the
ActionServlet according to the latest CVS commit at:
http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts
/action/ActionServlet.java?rev=1.178&only_with_tag=STRUTS_1_2_4&view=auto

If you want the example code that I used, here it is.  My package is
com.friedsoftware.struts.

// my ActionMapping subClass:
// ---
package com.friedsoftware.struts;
import org.apache.struts.action.ActionMapping;

public class ActionMappingExample extends ActionMapping {
String commands;

public String getCommands() {
return commands;
}

public void setCommands(String commands) {
this.commands = commands;
}
}

// ---
// My struts-config.xml global-forwards (which work)
// My action always does a lookup for the mapping "success"
// ---






// ---
// My struts-config.xml action setup and forward are:
// ---








// ---
// My example Action
// ---
package com.friedsoftware.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class ActionExample extends Action {
private Log log = LogFactory.getLog(this.getClass());

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
log.info("Checking mapping: " + request.getPathInfo());
log.info("Retrieving the ActionForward named 'success'");
ActionForward am = mapping.findForward("success");
log.info(" ActionForward of type: " + am.getClass().toString());

if (am.getClass().toString().equals(
"class 
com.friedsoftware.struts.ActionForwardExample")) {
ActionForwardExample newAm = (ActionForwardExample) am;
log.info("The cast was successful");
log.info(" Asking for property, it was set to '" +
newAm.getProperty() + "'.");
return (newAm);
}

return (am);
}
};

// ---
// And finally, my logged output showing it works:
// ---
[INFO] ActionExample - Checking mapping: /successDefault
[INFO] ActionExample - Retrieving the ActionForward named 'success'
[INFO] ActionExample -  ActionForward of type: class
com.friedsoftware.struts.ActionForwardExample
[INFO] ActionExample - The cast was successful
[INFO] ActionExample -  Asking for property, it was set to 'welcome'.

[INFO] ActionExample - Checking mapping: /successOverrideTest
[INFO] ActionExample - Retrieving the ActionForward named 'success'
[INFO] ActionExample -  ActionForward of type: class
com.friedsoftware.struts.ActionForwardExample
[INFO] ActionExample - The cast was successful
[INFO] ActionExample -  Asking for property, it was set to 'success'.


// end of all sorts of code...


I hope this 1.2.4 example set helps you.

Regards,
David

-Original Message-
From: John Crossman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 15, 2004 5:01 PM
To: Struts Users Mail

Re: Idea for chain and DB transactions

2004-09-18 Thread Sean Schofield
Craig,
Thanks for your response.  The main problem with that idea would be that I 
would have to count on the connection being in the context and the command 
would have to directly access the database.  I was thinking that my commands 
would be simple "facades" to the DAO layer.  That way I could leave my DAO's 
intact (and would be free to change them when I needed.)

Why not have the first command in the chain get a connection from the pool 
and store it in ThreadLocal?  Then the DAO's can use the connection without 
the commands having to deal with the connection or the datbase logic.  Do 
you see any drawbacks to this approach?

By the way, I do plan on still using postProcess() to the return the 
connection to the pool.

Atta,
You could write your own custom plugin that would initialize the chain 
stuff.  Note that commons-chain is its own project and does not have to be 
directly tied to Struts.  The struts-chain effort is going to use 
commons-chain to handle some of the behind the scenes struts implementation. 
Once its available you can probably piggyback off their plugin to initialize 
the chain stuff.

In the meantime, write your own plugin (use the one in struts-chain as a 
basis).  The plugin should store the Catalog in servlet context and can be 
used by your actions, etc.  Take a look at the CatalogConfiguratorPlugin 
that is in the contrib section of the nightly source tarball.

HTH,
sean
- Original Message - 
From: "atta-ur rehman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Craig McClanahan" 
<[EMAIL PROTECTED]>
Sent: Saturday, September 18, 2004 12:30 PM
Subject: Re: Idea for chain and DB transactions


Craig,
That sounds pretty exciting. Now, how could I, if at all, incorporate
this Filter/Chian functionality in my existing Struts 1.1 app?
ATTA
On Sat, 18 Sep 2004 07:19:45 -0700, Craig McClanahan <[EMAIL PROTECTED]> 
wrote:
Commons Chain (on which Struts Chain is based) has a design pattern
built in for the general case were one command in the chain wants to
allocate resources that will be required for later commands in the
chain, plus the ability to clean up that resource when the chain
completes.  See the Javadocs for org.apache.commons.chain.Filter.
For example, assume you want to allocate a connection from a
connection pool defined as a JNDI resource (the same principle applies
to any other sort of resource allocation factory) -- create a Filter
with the following functionality:
* In the execute() method, acquire a reference to the data source,
  acquire a connection, and store it as an attribute in the context.
  public boolean execute(Context context) throws Exception {
  InitialContext ic = new InitialContext();
  DataSource ds = (DataSource)
ic.lookup("java:comp/env/jdbc/CustomerDatabase");
  Connection conn = ds.getConnection();
  context.put("connection", conn);
  return false;
  }
* In the postprocess() method, call close() on the connection,
  which returns it to the pool:
  public boolean postprocess(Context context, Exception exception) {
Connection conn = (Connection) context.get("connection");
conn.close();
return false;
  }
  Note that the postprocessing method will be called even if an
exception was thrown in a
  subsequently called command.
In all other commands, the execute() method can simply use the
allocated resource, without having to care how it got there:
  public boolean execute(Context context) throws Exception {
Connection conn = (Connection) context.get("connection");
... use the connection to perform database transactions ...
  }
Using this design, you don't have to worry about external storage of
the allocated resources -- just store them under a well known
attribute name in the context object that is passed in to all
commands.
Craig
On Fri, 17 Sep 2004 14:43:57 -0400, Sean Schofield
<[EMAIL PROTECTED]> wrote:
> I have a problem and a proposed solution.  I would greatly appreciate 
> any feedback about the proposed solution.
>
> Problem:
> ===
> I'm currently using a Struts application with a connection pool (using 
> DBCP as supplied by Tomat).  When a database update is needed, the 
> Struts actions will call the facade which will talk to my service layer 
> (currently POJO's which handle business logic.)  My service layer in 
> turn talks to the appropriate DAO.  Each of these DAO's extends from a 
> common abstract class that provides basic functionality including 
> obtaining a connection from the DataSource (via the pool).  A key 
> aspect of my design is that some updates are in distinct areas of the 
> database and so I have different DAO's for each area (ex. one for 
> "workflow" on for "document.")
>
> As currently implemented I am unable to take advantage of transactions 
> because the two DAOs will be getting a connection indepently from the 
> pool and they will most likely not obtain the connection each time.  If 
> I could just get the same connection

Re: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-18 Thread Rick Reumann
Allistair Crossley wrote the following on 9/17/2004 8:40 AM:
however, because I am forced to use a tile definition or JSP in the
input parameter of the action for when the validation fails, i am unable
to load page attributes for that pid from my backend navigation system
and this is breaking my view.
Don't validate automatically. Manually validate in your Action. Example 
here: http://www.reumann.net/struts/articles/request_lists.jsp

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


RE: Slow Response Time (Tomcat 5.0.16)

2004-09-18 Thread David G. Friedman
Shailendar,

You mention "The application seems to be still slow since there is a data
transmitted from Browser to server."  So I have to ask some dumb questions:

1) Are your clients uploading large files?

2) Are those files being compressed by the client?
(compress/zip/winzip/winrar/gzip/etc.)

3) Are your clients performing the above tasks over slow connections, such
as dial-up?

Depending on your answers, the problem might be them, not necessarily Struts
or your server.  The last time this came up, the poster was complaining
about Struts problems when the issue was their clients sending uncompressed
large files (>1 MB) being uploaded over dial-up connections on a daily
basis.  So it depends no the particulars of the client-to-server direction
of tasks being performed.

-David

-Original Message-
From: Shailender Jain [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 18, 2004 4:44 AM
To: [EMAIL PROTECTED]
Subject: Slow Response Time (Tomcat 5.0.16)


Hello All,

I am using Struts Framework and Tomcat 5.0.16 for the development of my
application.

The application seems to be working very slow as there is a lot of data
transmitted over the net.
I used the HttpCompression technique to reduce the response time from
the server to browser.
But this has solved the problem in one direction i.e server to browser.
The application seems to be still slow since there is a data transmitted
from Browser to server.

Is there any way i can reduce this.
Like using Apache with Tomcat

Any indication will be helpful


Regards
shailender jain


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


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



Re: Idea for chain and DB transactions

2004-09-18 Thread atta-ur rehman
Craig,

That sounds pretty exciting. Now, how could I, if at all, incorporate
this Filter/Chian functionality in my existing Struts 1.1 app?

ATTA


On Sat, 18 Sep 2004 07:19:45 -0700, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> Commons Chain (on which Struts Chain is based) has a design pattern
> built in for the general case were one command in the chain wants to
> allocate resources that will be required for later commands in the
> chain, plus the ability to clean up that resource when the chain
> completes.  See the Javadocs for org.apache.commons.chain.Filter.
> 
> For example, assume you want to allocate a connection from a
> connection pool defined as a JNDI resource (the same principle applies
> to any other sort of resource allocation factory) -- create a Filter
> with the following functionality:
> 
> * In the execute() method, acquire a reference to the data source,
>   acquire a connection, and store it as an attribute in the context.
> 
>   public boolean execute(Context context) throws Exception {
>   InitialContext ic = new InitialContext();
>   DataSource ds = (DataSource)
> ic.lookup("java:comp/env/jdbc/CustomerDatabase");
>   Connection conn = ds.getConnection();
>   context.put("connection", conn);
>   return false;
>   }
> 
> * In the postprocess() method, call close() on the connection,
>   which returns it to the pool:
> 
>   public boolean postprocess(Context context, Exception exception) {
> Connection conn = (Connection) context.get("connection");
> conn.close();
> return false;
>   }
> 
>   Note that the postprocessing method will be called even if an
> exception was thrown in a
>   subsequently called command.
> 
> In all other commands, the execute() method can simply use the
> allocated resource, without having to care how it got there:
> 
>   public boolean execute(Context context) throws Exception {
> Connection conn = (Connection) context.get("connection");
> ... use the connection to perform database transactions ...
>   }
> 
> Using this design, you don't have to worry about external storage of
> the allocated resources -- just store them under a well known
> attribute name in the context object that is passed in to all
> commands.
> 
> Craig
> 
> On Fri, 17 Sep 2004 14:43:57 -0400, Sean Schofield
> 
> 
> <[EMAIL PROTECTED]> wrote:
> > I have a problem and a proposed solution.  I would greatly appreciate any feedback 
> > about the proposed solution.
> >
> > Problem:
> > ===
> > I'm currently using a Struts application with a connection pool (using DBCP as 
> > supplied by Tomat).  When a database update is needed, the Struts actions will 
> > call the facade which will talk to my service layer (currently POJO's which handle 
> > business logic.)  My service layer in turn talks to the appropriate DAO.  Each of 
> > these DAO's extends from a common abstract class that provides basic functionality 
> > including obtaining a connection from the DataSource (via the pool).  A key aspect 
> > of my design is that some updates are in distinct areas of the database and so I 
> > have different DAO's for each area (ex. one for "workflow" on for "document.")
> >
> > As currently implemented I am unable to take advantage of transactions because the 
> > two DAOs will be getting a connection indepently from the pool and they will most 
> > likely not obtain the connection each time.  If I could just get the same 
> > connection each time, then I could use setAutoCommit(false).
> >
> > Proposed Solution:
> > ==
> > I'm thinking I could set up a few chains for the various kind of updates.  The 
> > chains would be called by the POJO service layer (instead of calling the DAO's 
> > directly.)  The first Command in the chain would be to indentify all database 
> > updates in the chain as needing transactions.  This would be done through a static 
> > method on a new object called TransactionManager.  Basically I would have a 
> > hashtable that would maintain connections for the duration of the chain.  The 
> > connections would be stored by the current thread (use that as the key to the 
> > table.)
> >
> > Then when a command down the line needs a database connection, it would first 
> > check to see if there is one already set aside for it to use.  Actually the 
> > command would call the DAO and the DAO would check.  The command would also be 
> > decorated by a custom wrapper so that if the DAO's try to close the connection, 
> > I'll ignore it.  Then when the chain does the post processing in reverse order.  
> > So the last clean up step will be to check for my custom DAOException.  If there 
> > is one, then rollback, otherwise commit.  Finally, the connection is removed from 
> > the TransactionManager.
> >
> > I think this might be crazy enough to work.  I know we could allways use EJB and 
> > get transactions but that might be overkill since the volume is very light (this 
> > is custom software for a governmen

Re: Validation in Struts

2004-09-18 Thread Rogue Chameleon
In your ActionForm, add the validation to the validate method.

For example, you would have something like this:

public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

if ((person == null) || (person.length() < 1))
  errors.add("person", new ActionError("ch03.hello.no.person.error"));

return errors;
  }


where 'person' is the name of the select box field.


On Sat, 18 Sep 2004 21:41:49 +0530, Priya Jotwani
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a page where a user should select something from the dropdown
> before clicking on Submit. If he doesn't selects anything, an
> errorMessage should get displayed on the same page saying  ' Please
> select an option '
> 
> How can I do such validations in Struts.
> 
> Thanks in Advance,
> 
> Priya
> 
> 



-- 
...
Rogue Chameleon
...

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



RE: Validation in Struts

2004-09-18 Thread David G. Friedman
Priya,

Use the "required" validator rule and be sure to use the html:javascript tag
in your JSP to have the client-side Javascript embedded in the page given
out to the user. See the first validator, "required", at the below URL:

http://struts.apache.org/userGuide/dev_validator.html#builtin

Regards,
David

-Original Message-
From: Priya Jotwani [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 18, 2004 12:12 PM
To: Struts Users Mailing List
Subject: Validation in Struts


Hi,



I have a page where a user should select something from the dropdown
before clicking on Submit. If he doesn't selects anything, an
errorMessage should get displayed on the same page saying  ' Please
select an option '

How can I do such validations in Struts.



Thanks in Advance,

Priya



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



Re: Tutorial for DAO with Struts

2004-09-18 Thread Vic
http://www.reumann.net/struts/ibatisLesson1.do
.V
Hari Haran wrote:
check this link
https://strutsejb.dev.java.net/
most of the DAO access is done through EJB, but u will get some good
idea about struts and DAO
-Hari
On Sat, 18 Sep 2004 10:38:34 +0200, Manuel Wissmann <[EMAIL PROTECTED]> wrote:
Hi Folks!
Does somebody know a good tutorial for DAO (Data Acess Objects) with struts?
THX
Manu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Please post on Rich Internet Applications User Interface (RiA/SoA)

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


Validation in Struts

2004-09-18 Thread Priya Jotwani
Hi,

 

I have a page where a user should select something from the dropdown
before clicking on Submit. If he doesn't selects anything, an
errorMessage should get displayed on the same page saying  ' Please
select an option '

How can I do such validations in Struts.

 

Thanks in Advance,

Priya



Re: JTidy integration?

2004-09-18 Thread Craig McClanahan
Using a servlet filter would be the easiest way to implement something
like this (no change required to your application or to Struts), but
I'm having a hard time understanding why anyone would want to spend
the extra server side processing cycles for doing this.  It won't have
any affect on the semantics of the HTML page, and won't even be
visible to a browser user unless they use the "View Source" option.

If you're interested in this solely to reduce the number of whitespace
characters, you'd be better off designing a filter that just focused
on collapsing those (which will run a lot faster than a general HTML
tidying application).  Alternatively, if your client browser support
processing compressed responses, you might look at using a Filter that
applies compression on the entire response stream, thereby reducing
the number of bytes sent down the wire.  Tomcat has an example filter
in its source code that does exactly this sort of thing.

Craig


On Fri, 17 Sep 2004 20:15:12 -0500, Dave Bender <[EMAIL PROTECTED]> wrote:
> Has anybody integrated JTidy or any of the other HTML-prettifiers with
> Struts?  I find Tidy does a good job of cleaning up JSPs, which tend to get
> pretty spaced out particularly when there are lots of includes, but I don't
> have a clear idea of where it would plug in.   Would it make sense to put it
> into a servlet filter and then chain that onto the Struts controller
> servlet?  Or is there a logical spot to put that functionality somewhere
> inside the framework (attach to an action or something??).  Or would it be a
> plug in?
> 
> Thoughts?
> 
> Dave
> 
>

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



Re: Idea for chain and DB transactions

2004-09-18 Thread Craig McClanahan
Commons Chain (on which Struts Chain is based) has a design pattern
built in for the general case were one command in the chain wants to
allocate resources that will be required for later commands in the
chain, plus the ability to clean up that resource when the chain
completes.  See the Javadocs for org.apache.commons.chain.Filter.

For example, assume you want to allocate a connection from a
connection pool defined as a JNDI resource (the same principle applies
to any other sort of resource allocation factory) -- create a Filter
with the following functionality:

* In the execute() method, acquire a reference to the data source,
  acquire a connection, and store it as an attribute in the context.

  public boolean execute(Context context) throws Exception {
  InitialContext ic = new InitialContext();
  DataSource ds = (DataSource)
ic.lookup("java:comp/env/jdbc/CustomerDatabase");
  Connection conn = ds.getConnection();
  context.put("connection", conn);
  return false;
  }

* In the postprocess() method, call close() on the connection,
  which returns it to the pool:

  public boolean postprocess(Context context, Exception exception) {
Connection conn = (Connection) context.get("connection");
conn.close();
return false;
  }

  Note that the postprocessing method will be called even if an
exception was thrown in a
  subsequently called command.

In all other commands, the execute() method can simply use the
allocated resource, without having to care how it got there:

  public boolean execute(Context context) throws Exception {
Connection conn = (Connection) context.get("connection");
... use the connection to perform database transactions ...
  }

Using this design, you don't have to worry about external storage of
the allocated resources -- just store them under a well known
attribute name in the context object that is passed in to all
commands.

Craig

On Fri, 17 Sep 2004 14:43:57 -0400, Sean Schofield
<[EMAIL PROTECTED]> wrote:
> I have a problem and a proposed solution.  I would greatly appreciate any feedback 
> about the proposed solution.
> 
> Problem:
> ===
> I'm currently using a Struts application with a connection pool (using DBCP as 
> supplied by Tomat).  When a database update is needed, the Struts actions will call 
> the facade which will talk to my service layer (currently POJO's which handle 
> business logic.)  My service layer in turn talks to the appropriate DAO.  Each of 
> these DAO's extends from a common abstract class that provides basic functionality 
> including obtaining a connection from the DataSource (via the pool).  A key aspect 
> of my design is that some updates are in distinct areas of the database and so I 
> have different DAO's for each area (ex. one for "workflow" on for "document.")
> 
> As currently implemented I am unable to take advantage of transactions because the 
> two DAOs will be getting a connection indepently from the pool and they will most 
> likely not obtain the connection each time.  If I could just get the same connection 
> each time, then I could use setAutoCommit(false).
> 
> Proposed Solution:
> ==
> I'm thinking I could set up a few chains for the various kind of updates.  The 
> chains would be called by the POJO service layer (instead of calling the DAO's 
> directly.)  The first Command in the chain would be to indentify all database 
> updates in the chain as needing transactions.  This would be done through a static 
> method on a new object called TransactionManager.  Basically I would have a 
> hashtable that would maintain connections for the duration of the chain.  The 
> connections would be stored by the current thread (use that as the key to the table.)
> 
> Then when a command down the line needs a database connection, it would first check 
> to see if there is one already set aside for it to use.  Actually the command would 
> call the DAO and the DAO would check.  The command would also be decorated by a 
> custom wrapper so that if the DAO's try to close the connection, I'll ignore it.  
> Then when the chain does the post processing in reverse order.  So the last clean up 
> step will be to check for my custom DAOException.  If there is one, then rollback, 
> otherwise commit.  Finally, the connection is removed from the TransactionManager.
> 
> I think this might be crazy enough to work.  I know we could allways use EJB and get 
> transactions but that might be overkill since the volume is very light (this is 
> custom software for a government agency not ecommerce.)  Please let me know what you 
> think.  A big question I have is about storing and retrieving the datbase connection 
> using the current thread as the key to a hashtable.  Also, I know that I will have 
> to be careful with thread synchronization.
> 
> Thanks,
> sean
> 
>

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

Re: Action mapping Path resolution

2004-09-18 Thread Frank W. Zammetti (MLists)
I think your getting confused because when you set up a path to an Action,
it's a virtual path, but when it's a forward, it's a physical path, in
BOTH cases it's relative to the root of your webapp.

For instance... You may have an Action that you map to the path
"/my/action/is/the/best/Action.act"  So that string is literally the
target of your form.  Your physical directory structure however probably
doesn't have any of those directories.  That's OK, if this is in an
 tag in struts-config.xml, the resource will be found because the
incoming URI can be mapped to that Action's path attribute.

When you write the path for a forward however, you are referencing a
physical resource (well, usually anyway, assuming it's a JSP).  In that
case, the path you see WILL be a real path, like
"/myProject/jsp/myJSP.jsp" in your case.  The exception is if you forward
to another Action (which you of course can do), then the path will be
"virtual" as before.

On your second point about window sizes, I'm 99% sure there's nothing in
Struts specifically that will help you.  You'll have to open the window
via Javascript and set it's size there.  Just load your popup.jsp into it
and you should be all set.

Hope this helped!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Sat, September 18, 2004 5:07 am, Ryan julius said:
>
> Hi,
>
> I am trying to master, Struts.
>
> I am creating a struts application with the following settings, and I am
> getting confused with the concept of the struts action "path".
>
> Directory tree:
>
> ==
>
> c:\project\adminProject => the root of my project called adminProject
>
> c:\project\adminProject\jsp => for jsp pages
>
> c:\project\adminProject/src/org/mycomp/user/action/AdminUserAction.java
>
> CreateUser.jsp:
>
> =
>
>  type="org.mycomp.user.form.AdminUserForm" >
>
> struts-config.xml:
>
> =
>
>  />
>
>  type="org.mycomp.user.action.AdminUserAction" parameter="dispatch"
> validate="true" scope="session" input="/web/jsp/user/AdminUser.jsp">
>
> 
>
> 
>
> Questions:
>
> 1.) I have been explained that the "path is a context-relative path of the
> submitted request starting with / character and omitting any file name
> extension if extension mapping is being used." (ref. Chuck C. book, and
> ...)
>
> This definition is abstract for me. What is the path of a request? And
> mainly, which context is concerned here? Is it the container context or
> the application context?
>
> a.) How do you setup that context?
>
> b.)How do struts resolves the path within its flow of execution?
>
> c.)What are the rules of setting the path in order to avoid errors like
> "resource (/web/jsp/user/AdminUser) not found!"?
>
> d.)Is there any advantage of setting : path="/web/jsp/user/AdminUser"
> instead of path="/AdminUser"?
>
> 
>
> 2.) I would like the PopupMenu.jsp being a page into a window of a given
> size let say width=300 and height=200. At the moment, the content of my
> PopupMenu.jsp is displayed into a large window. I would like to
> dynamically set the size of this window.
>
> Thanks for your reply.
>
>
>
> -
> Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
> Créez votre Yahoo! Mail
>
> Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés
> pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !


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



Re: Struts and Macromedia Flash

2004-09-18 Thread Lorenzo Sicilia
James Mitchell wrote:
You do the same thing as anyone else.  It does not matter if the request
came from a "web browser" or a "browser plugin" such as an applet, flash, or
some other embedded component.  It is all the same to the servlet container
and thus is the same to Struts.
ok, but if I want use  actionForm with xml flash output I guess it'is 
different. I need translate xml to some things like as form field values 
because Struts work with post data.
Anyway thanks for the answer. I understand that if I send my data  with 
"post" may be actionForm work.
I can use error tag, too?

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


Re: Tutorial for DAO with Struts

2004-09-18 Thread Hari Haran
check this link

https://strutsejb.dev.java.net/

most of the DAO access is done through EJB, but u will get some good
idea about struts and DAO

-Hari


On Sat, 18 Sep 2004 10:38:34 +0200, Manuel Wissmann <[EMAIL PROTECTED]> wrote:
> Hi Folks!
> 
> Does somebody know a good tutorial for DAO (Data Acess Objects) with struts?
> 
> THX
> Manu
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



-- 
-Hari Haran

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



Action mapping Path resolution

2004-09-18 Thread Ryan julius

Hi,

I am trying to master, Struts.

I am creating a struts application with the following settings, and I am getting 
confused with the concept of the struts action "path".

Directory tree:

==

c:\project\adminProject => the root of my project called adminProject

c:\project\adminProject\jsp => for jsp pages

c:\project\adminProject/src/org/mycomp/user/action/AdminUserAction.java

CreateUser.jsp:

=



struts-config.xml:

=









Questions:

1.) I have been explained that the "path is a context-relative path of the submitted 
request starting with / character and omitting any file name extension if extension 
mapping is being used." (ref. Chuck C. book, and ...)

This definition is abstract for me. What is the path of a request? And mainly, which 
context is concerned here? Is it the container context or the application context?

a.) How do you setup that context? 

b.)How do struts resolves the path within its flow of execution?

c.)What are the rules of setting the path in order to avoid errors like "resource 
(/web/jsp/user/AdminUser) not found!"? 

d.)Is there any advantage of setting : path="/web/jsp/user/AdminUser" instead of 
path="/AdminUser"? 



2.) I would like the PopupMenu.jsp being a page into a window of a given size let say 
width=300 and height=200. At the moment, the content of my PopupMenu.jsp is displayed 
into a large window. I would like to dynamically set the size of this window.

Thanks for your reply.



-
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour 
dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !

Slow Response Time (Tomcat 5.0.16)

2004-09-18 Thread Shailender Jain
Hello All,

I am using Struts Framework and Tomcat 5.0.16 for the development of my
application.

The application seems to be working very slow as there is a lot of data
transmitted over the net.
I used the HttpCompression technique to reduce the response time from
the server to browser.
But this has solved the problem in one direction i.e server to browser.
The application seems to be still slow since there is a data transmitted
from Browser to server.

Is there any way i can reduce this.
Like using Apache with Tomcat

Any indication will be helpful


Regards
shailender jain


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



Tutorial for DAO with Struts

2004-09-18 Thread Manuel Wissmann
Hi Folks!
Does somebody know a good tutorial for DAO (Data Acess Objects) with struts?
THX
Manu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]