redirecting to fully qualified hostname

2004-01-13 Thread Fullam, Jonathan
All,

The application I am working on is secured with a login that required a
username and password.  Once a user is logged in, all pages can be accessed
as long as there is a Subject object in the Session.  My problem is that
part of the webapp provided links to pages that open in another window, and
when the link is clicked, it is forwarding to the logon page as if the
Subject object is no longer in the Session.  I've determined that this
behavior is only present when the hostname used for the request is not fully
qualified upon the intial logon.

For instance.

User logons on by going to http://serverName/webapp/logon.do

Then the application provides a link to
http://serverName.mycompany.com/webapp/something.do which open a page in a
new window.

When the user click the link, a new window is opened but they are forwarded
to the logon page as if they never logged on in the first place.

How can I have all requests to the original hostname
http://serverName/webapp be redirected to
http://serverName.mycompany.com/webapp ?  Is there anybody out there that
has experienced this or knows of a better way to work around this issue?

Thanks in Advance,
Jonathan


RE: URGENT - Help defending Struts

2003-12-18 Thread Fullam, Jonathan
www.verizonwireless.com

-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 10:53 AM
To: [EMAIL PROTECTED]
Subject: RE: URGENT - Help defending Struts


http://www.paychex.com/demos/s125/index.html
you can't directly access it, because it's a subsription service, but 
there's a flash tour of the site.


From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: URGENT - Help defending Struts
Date: Thu, 18 Dec 2003 09:48:35 -0600

All:



Our CIO is currently fighting the use of Struts by saying that it is not
widely used in B2C sites.  Does anyone know of any sites, preferably
commerce sites that are using Struts?  This would be extremely helpful.



The issue is that the CIO is looking for sites that may be similar to
ours that are using Struts already.



Thanks very much,

Russell



[EMAIL PROTECTED]

310-426-5587





This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information.  If you have 
received it in error, please notify the sender immediately and delete the 
original.  Any other use of the email by you is prohibited.

_
Enjoy the holiday season with great tips from MSN.  
http://special.msn.com/network/happyholidays.armx


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


RE: Help on form reset

2003-12-17 Thread Fullam, Jonathan
No, the reset method will automatically be called on a Session scoped
ActionForm upon each request.  Request scoped ActionForms are newly
instantiated upon each request so, with Request scoped ActionForms, the
reset method is irrelevant.
-Jonathan

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:06 AM
To: 'Struts Users Mailing List'
Subject: Help on form reset



Hi,

I am new to struts..
I understand that the validate method of the Action form can be called
based on the validate 
attribute in struts_config.xml.
Similarly, for the reset method, can we configure in the xml file.

Regards
VasudevRaoGupta


Confidentiality Notice 

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

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


RE: Struts internal error

2003-12-17 Thread Fullam, Jonathan
You can get the root cause of an internal exception by looking about half
way down the stack trace.  In your case it is:

root cause

java.lang.IllegalAccessError: tried to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor

-Jonathan

-Original Message-
From: Julien Martin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 12:53 PM
To: Struts Users Mailing List
Subject: Struts internal error


Hello,
I am working on a fairly complex application and I am running into a struts
internal error.  Can anyone tell me how to sort it please.

Here is the exception trace:

***
HTTP Status 500 -




type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
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.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
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:601)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:536)

root cause

java.lang.IllegalAccessError: tried to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor
at
org.apache.commons.beanutils.MappedPropertyDescriptor.getPublicDeclaredMetho
ds(MappedPropertyDescriptor.java:383)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.internalFindMethod(Map
pedPropertyDescriptor.java:453)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.findMethod(MappedPrope
rtyDescriptor.java:527)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.(MappedPropertyDescrip
tor.java:149)
at
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUti
ls.java:907)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1096)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:816)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420

RE: Login Security

2003-12-16 Thread Fullam, Jonathan
You could put a cookie on the user's machine that expires after a certain
period of time.  Of course this only works when cookies are turned one and
an experienced user could always manually remove their cookie.

Another solution maybe is to get the user's IP address from the request
Header and add it to a list of invalid IP address with their times of entry.
Then upon a new request, you will have to check the list and determine how
long ago the IP address was added.

I'm just brainstorming here so anybody can criticize these suggestions
freely.
-Jonathan

-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 10:55 AM
To: [EMAIL PROTECTED]
Subject: Login Security


I'm writing a web application using JSP and Struts. I want to add a
security feature to my login page where if a user has three unsuccessful
logins they will be unable to log in for a certain period of time
afterwards. I can count the number of unsuccessful logins ok but how I'm
not sure how to give a timeout after 3 failures. Any ideas how I could
implement this?
 
Thanks


RE: question on DynaActionForm

2003-12-15 Thread Fullam, Jonathan
Jim,
I'm not exactly sure what the book means when they say that whether you use
an ActionForm or a DynaActionForm should be transparent, but once you use
DynaActionForm, you form is no longer of type RegisterForm (hence the
ClassCastException).  You must cast it to DynaActionFrom now as in:

DynaActionFrom rf = (DynaActionForm) form;

Also,  you will need to access the data in rf differently now...

rf.get(Name of property);

-Jonathan

-Original Message-
From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 9:52 AM
To: Struts Users Mailing List
Subject: question on DynaActionForm


I'm trying to modify the simple Register application from Chapter 1 of
Struts in Action to use a DynaActionForm in place on the ActionForm shown
in the book. I've modified struts-config.xml accordingly. According to the
book, whether you use an ActionForm or a DynaActionForm should be
transparent. However, when I attempt to run the modified app I get a
ClassCastException at the following line in RegisterAction.java:

RegisterForm rf = (RegisterForm) form;

I'm sure it's something dumb, but I'm not seeing it. Any help appreciated.

Thanks,

jim




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


RE: [OFF TOPIC] STRUTS PROGRAMMER JOB.

2003-12-11 Thread Fullam, Jonathan
jobs are real easy to get and starting salaries are anywhere from 150K to
350K per year.

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 3:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [OFF TOPIC] STRUTS PROGRAMMER JOB.


$4.75?! 

Dang, I am getting robbed!

Larry

 [EMAIL PROTECTED] 12/11/03 4:36 PM 
Actually that figure is a bit high .. 4.75/hr if you want Health Insurance
Saludos,
Martin
- Original Message - 
From: Marcus Peixoto [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 1:28 PM
Subject: Re: [OFF TOPIC] STRUTS PROGRAMMER JOB.


 Are you kidding ? Are programmers for sale in US ?

 Em Qui, 2003-12-11 às 20:59, Martin Gainty escreveu:
  Going rate is about 6$/hr
  - Original Message - 
  From: Tiago Henrique Costa Rodrigues Alves
  [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Sent: Thursday, December 11, 2003 1:37 PM
  Subject: RE: [OFF TOPIC] STRUTS PROGRAMMER JOB.
 
 
   I wrote my email wrong: [EMAIL PROTECTED]
  
   YOU DONT NEED TO REPLY TO THE MAILING LIST send me an email
   ([EMAIL PROTECTED])
  
   Sorry for the off topic, but I just need to hear from you guys...
  
   I am looking for an American Job, I live in Brazil and I have 2 years
   experience in Java + Struts + OJB + Apache + TomCat + UML + PHP + ASP.
Web
   in General
  
   How much an Web/Java Developer can make?
  
   How easy can I get a job from Brazil?
  
   Thanks,
   Tiago Henrique C. R. Alves
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



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



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


RE: When HashMap will replace ActionForm ?

2003-12-10 Thread Fullam, Jonathan
That's where a map-backed Hashmap is useful.  

-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 6:02 AM
To: Struts Users Mailing List
Subject: Re: When HashMap will replace ActionForm ?


I know that but one have to define 10 to 30 elements in struts-config.xml
for that. With a hash map one have to say whether it is needed ot not. It
could be accessed like DynaValidator form. And my requirement is to store
simple text field values.

rgds
Antony Paul.

- Original Message -
From: Kalra, Ashwani [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 4:05 PM
Subject: RE: When HashMap will replace ActionForm ?


 DynaValidator forms stores data in Hashmap internally if you dont want to
 define norma action forms.




 -Original Message-
 From: Antony Paul [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 10, 2003 2:40 PM
 To: struts
 Subject: When HashMap will replace ActionForm ?
 
 
 Hi,
 Is there any move to support HashMap in place of
 ActionForm ?. I dont
 want to start any argument. I have read a lot on ActionForm in
 this archive.
 
 rgds
 Antony Paul.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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

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



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


RE: 'Module scoped' variables

2003-12-10 Thread Fullam, Jonathan
Not sure if it's exactly what you want but I know you can use the parameter
attribute of the action tags to specify a value that is accessible using
mapping.getParameter() from withing you Action class.

action
...
...
parameter=someValue/

-Jonathan

-Original Message-
From: Lawrence Williams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 11:20 AM
To: [EMAIL PROTECTED]
Subject: 'Module scoped' variables


Hi,

Hope this isn't too naïve a question Is there anyway of setting
parameters in a module-level struts-config file and referencing those
variables within an action?

Effectively giving me a module scope.

Regards
Lawrence

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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


RE: Tag for adding no-cache header.

2003-12-10 Thread Fullam, Jonathan
Setting the nocache in the web.xml has actually been deprecated.  A better
solution for you is to set the nocache header as an attribute inside the
controller element of you struts-config file.  

-Jonathan

-Original Message-
From: Trieu, Danny [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 11:31 AM
To: 'Struts Users Mailing List'
Subject: RE: Tag for adding no-cache header.


In your deployment descriptor, web.xml, you can can set the ActionServlet's
parameter no-cache=true.  The container will take care of this for you as
long as all of your request go through the FrontController.

Danny Trieu 
Internet Business Group 
Downey Savings and Loan Association, F.A. 
[EMAIL PROTECTED]
(949) 509-4564

The beginning of knowledge is the discovery of something we do not
understand.
- Frank Herbert (1920-1986)
The essence of knowledge is, having it, to apply it; not having it, to
confess your ignorance.
- Confucius (551-479 BC)




-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 3:16 AM
To: struts
Subject: Tag for adding no-cache header.


Hi,
Does any Struts tag generate the headers necessary to say browser not to
cache a JSP page. It still exists as a scriptlet in my JSP. If one is added
it will be useful. I think every dynamic page need this.

rgds
Antony Paul.


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


This message and any attachments are for the intended recipient(s) only and
may contain privileged, confidential and/or proprietary information about
Downey Savings or its customers, which Downey Savings does not intend to
disclose to the public. If you received this message by mistake, please
notify the sender by reply e-mail and delete the message and attachments.

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


RE: 'Module scoped' variables

2003-12-10 Thread Fullam, Jonathan
Yes.  I actually thought of that issue after I replied to you.  

Another option you can look into is subclassing the ControllerConfig class
and specify your new Config class in the className attribute of the
controller element in each of your modules.  You could then build in the
functionality to configure extra module-scoped variable.
 
-Jonathan

-Original Message-
From: Lawrence Williams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 11:35 AM
To: Struts Users Mailing List
Subject: RE: 'Module scoped' variables


Thanks Jonathan,

That's kind of the half solution I have at present - the problem is I have
to specify the parameter in all my actions as it is 'global to the module'.
This makes changing the value a bit tedious. Does this make sense?

Regards
Lawrence

-Original Message-
From: Fullam, Jonathan [mailto:[EMAIL PROTECTED] 
Sent: 10 December 2003 16:23
To: 'Struts Users Mailing List'
Subject: RE: 'Module scoped' variables

Not sure if it's exactly what you want but I know you can use the parameter
attribute of the action tags to specify a value that is accessible using
mapping.getParameter() from withing you Action class.

action
...
...
parameter=someValue/

-Jonathan

-Original Message-
From: Lawrence Williams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 11:20 AM
To: [EMAIL PROTECTED]
Subject: 'Module scoped' variables


Hi,

Hope this isn't too naïve a question Is there anyway of setting
parameters in a module-level struts-config file and referencing those
variables within an action?

Effectively giving me a module scope.

Regards
Lawrence

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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


RE: Tabbed menus using Tiles

2003-12-10 Thread Fullam, Jonathan
Look into using the struts-menu libraries.  It contains tabbed menus.
http://raibledesigns.com/wiki/Wiki.jsp?page=StrutsMenu
-Jonathan

-Original Message-
From: Gopal Venkata Achi [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 3:36 PM
To: Struts Users Mailing List
Subject: Tabbed menus using Tiles


Hi All,

I am presently designing a web application, and curious to learn whether
there is any way we can create and use the tabbed menus using Struts
libraries.  We have chosen tiles for the layout design already.

I appreciate any help.

cheers

gopal



[OT] - Login Application

2003-12-09 Thread Jonathan Hawkins
Howdy All,
I am writing a custom login application.
Our organization has several web applications (Struts of course!)
one of which is a shopping cart.
The current login application adds two cookies to the users browser - 
one that stores a number representing a price index and the other an id.
(Meaning different users pay different amounts for products depending 
on their level of membership).

The issue:
I am adding a 30 day persistence feature to the login if the user 
selects a check box at login time.
It is possible that a users price index will change within a 30 day 
period due to advancement in their membership.

Should the shopping cart (or any other app that needs to calculate 
price) be responsible for getting the price index vs. the login getting 
it?

Has anyone had a similar situation and if so, how did you solve it?

Thanks in advance,
Jonathan Hawkins
Web Programmer
American College of Chest Physicians
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Help Migrating from WebTier to Struts

2003-12-05 Thread Jonathan . Crain
I am trying to migrate a 3ed party application from Macromedia's Jrun
platform to Tomcat.  The developers used a WebTier framework to create the
app.  I cannot reach the developers and was wondering if anyone has had
experience in switching form WebTier to Struts.  I am a complete newbie to
Tomcat and Struts and am in dire straits to get this to work.  

Error (for what it's worth):
An error occurred at line: 25 in the jsp file: /jsp/index.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\trac\jsp\index_jsp.java:7: package
webtier.view.controllers does not exist
import webtier.view.controllers.ViewController;
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\trac\jsp\index_jsp.java:62: cannot resolve
symbol
symbol  : class ViewController 
location: class org.apache.jsp.index_jsp
ViewController vc = new ViewController(request, response,
pageContext);
^

Any information would be greatly appreciated!  

Thanks in advance,

Jonathan Crain
City of Austin
Internet Operations
Communications and Technology Management Office




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



RE: How do I combine tiles and pre-populated forms?

2003-12-04 Thread Fullam, Jonathan
Jay,

Make sure the following is after /action-mappings in your struts config
file (IF YOU HAVEN'T DONE SO ALREADY):


plug-in className=org.apache.struts.tiles.TilesPlugin
set-property property=definitions-config

value=/WEB-INF/opus-tiles.xml /
set-property property=definitions-debug value=2 /
set-property property=definitions-parser-detail value=2
/
set-property property=definitions-parser-validate
value=true /
/plug-in

where you point to your own opus-tiles.xml.

Then, use the following mapping:

action
path=/ViewSystemProperties
type=com.nci.action.telco.ViewSystemProperties
scope=request
name=SystemProperties
parameter=/telco_edit_system_properties
validate=false
forward name=success path=telco.system_properties/
/action

After you pre-populate your form in the ViewSystemProperties action.

return mapping.findForward(success);

-Jonathan


-Original Message-
From: Glanville, Jay [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 11:02 AM
To: Struts User List
Subject: How do I combine tiles and pre-populated forms?


Hello All.

I'm a nubie and I'm having a little problem.  I need to combine an
action mapping to pre-populate a form, with an action mapping for a tile
definition.

Let me go into more detail ...

I have an action mapping that gets the information for a form, populates
the form and then forwards on to the page containing the form.  The
mapping looks like this:
action
path=/ViewSystemProperties
type=com.nci.action.telco.ViewSystemProperties
scope=request
name=SystemProperties
parameter=/telco_edit_system_properties
validate=false
/action
The name attribute is a form bean I've defined in the form-beans
section, which subclasses action form and does all the necessary
validation of the form.  The type in the above action is a subclass of
Action which goes to the database and gets the appropriate information,
and then sets the form's properties.  The type class then uses the
parameter attribute to forward on to our internal templating framework
that we want to get rid of.

As we want to get rid of our internal templating framework and use
tiles, I came up with the following action mapping:
action
path=/ViewSystemProperties
type=org.apache.struts.actions.ForwardAction
parameter=telco.system_properties
/action
The parameter attribute is a tile definition (from tiles-def.xml).
The problem with this is that I can't do the necessary work with
pre-populating the form.

With the first solution, I can pre-populate a form.  With the second
solution, I can use the tiling framework.  Now the big question: how do
I combine both solutions so that I can pre-populate my form and use the
tiling framework?

Thanks in advance.



Jay Dickon Glanville

PS: If this email comes through as HTML or RTF, I apologize.  I BELIEVE
I've setup this email for plain text, but I could be wrong.

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


RE: How do I combine tiles and pre-populated forms?

2003-12-04 Thread Fullam, Jonathan
Sorry...I replied before I received this response.

-Original Message-
From: Greg Reddin [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 2:47 AM
To: Struts Users Mailing List
Subject: Re: How do I combine tiles and pre-populated forms?


Jay,

Use the first action mapping, but do it like this:

  action
  path=/ViewSystemProperties
  type=com.nci.action.telco.ViewSystemProperties
  scope=request
  name=SystemProperties
  validate=false
  forward name=success path=telco.system_properties/
  /action

Then in your ViewSystemProperties action do this:

  return mapping.findForward(success);

Greg

Glanville, Jay wrote:
 Hello All.
 
 I'm a nubie and I'm having a little problem.  I need to combine an
 action mapping to pre-populate a form, with an action mapping for a tile
 definition.
 
 Let me go into more detail ...
 
 I have an action mapping that gets the information for a form, populates
 the form and then forwards on to the page containing the form.  The
 mapping looks like this:
 action
 path=/ViewSystemProperties
 type=com.nci.action.telco.ViewSystemProperties
 scope=request
 name=SystemProperties
 parameter=/telco_edit_system_properties
 validate=false
 /action
 The name attribute is a form bean I've defined in the form-beans
 section, which subclasses action form and does all the necessary
 validation of the form.  The type in the above action is a subclass of
 Action which goes to the database and gets the appropriate information,
 and then sets the form's properties.  The type class then uses the
 parameter attribute to forward on to our internal templating framework
 that we want to get rid of.
 
 As we want to get rid of our internal templating framework and use
 tiles, I came up with the following action mapping:
 action
 path=/ViewSystemProperties
 type=org.apache.struts.actions.ForwardAction
 parameter=telco.system_properties
 /action
 The parameter attribute is a tile definition (from tiles-def.xml).
 The problem with this is that I can't do the necessary work with
 pre-populating the form.
 
 With the first solution, I can pre-populate a form.  With the second
 solution, I can use the tiling framework.  Now the big question: how do
 I combine both solutions so that I can pre-populate my form and use the
 tiling framework?
 
 Thanks in advance.
 
 
 
 Jay Dickon Glanville
 
 PS: If this email comes through as HTML or RTF, I apologize.  I BELIEVE
 I've setup this email for plain text, but I could be wrong.
 
 -
 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]


Subclassing ActionServlet

2003-12-04 Thread Fullam, Jonathan
All,

I need to check the Session for an authenticated user before most requests.
To do this I subclassed ActionServlet and only call super(request, response)
upon verification that authenticated user is in the Session. 

if (request.getRequestURI().endsWith(welcome.do) |
request.getRequestURI().endsWith(logon.do) |
request.getRequestURI().endsWith(html))
{
super.process(request, response);
}


else if (request.getSession().getAttribute(USER) == null)
{
//Forward to login page
response.sendRedirect(/welcome.do);
}

 I also know about the ability to subclass the RequestProcessor and
providing my own implementation of the processPreprocess method to
accomplish the same thing.

Does anybody know of any serious disadvantages or side effects of
subclassing the ActionServlet class rather than the RequestProcessor class.


RE: Why isn't an ActionForm just a Map?

2003-12-03 Thread Fullam, Jonathan
One guess would be because then you would lose some of the methods which
provide more functionality than just a TransferObject provides. Such methods
are validate and reset.

-Jonathan

-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 8:39 AM
To: struts
Subject: Why isn't an ActionForm just a Map? 


This question is from the table of contents of a text book. I dont have this
book in hand.
I have other questions also.
Why ActionForm is made Struts dependent ?.
Why not use just plain JavaBean whch can be used as TransferObject. ?

rgds
Antony Paul

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


RE: Variable value in logic:equal tag Help Req

2003-12-03 Thread Fullam, Jonathan
You can use a variable for the value attribute just as you did:  %=
refValue % as long as refValue is a variable in some scope on your page.
Note that refValue must point to a String object because the equal tag
requires this (it converts the value of the bean pointed to by the name
attribute to a String for comparisons).  If refValue is not a String you can
try the following %= refValue.toString() %.

-Jonathan

-Original Message-
From: Shakti [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:27 AM
To: Struts Developers List; Struts Users Mailing List
Subject: Variable value in logic:equal tag Help Req


With reference this mail :
I trid this code but i am getting the error :can not resolve symbol refValue
:\bea\user_projects\mydomain\myserver\.wlnotdelete\mcc_mcc_4346456\jsp_servl
et\__reassignta.java:376: cannot resolve symbol
probably occurred due to an error in /reassignta.jsp line 118:
logic:equal name=reassignedTaId value=%= refValue % 

I want to compare values from one arraylist with another using logic equal
tag but in the value= tag how i can give a variable ??
Plz Help !!!
Thanks  Regards,
Shakti



- Original Message -
From: Nicolas De Loof [EMAIL PROTECTED]
To: Struts Developers List [EMAIL PROTECTED]
Sent: Monday, November 24, 2003 4:38 PM
Subject: Re: variable value in logic notEqual tag


 Use this :

 bean:define id=refValue name=beanRef property=foo/
 logic:equal name=beanToCompare property=bar value=%= refValue % 
 ...
 /logic:equal


 Nico.

 - Original Message -
 From: Baljinder Singh [EMAIL PROTECTED]
 To: Struts Developers List [EMAIL PROTECTED]
 Sent: Monday, November 24, 2003 12:03 PM
 Subject: variable value in logic notEqual tag


  Hi All,
 
  I want to compare the variable in notEqual tag to value of another
variable
  instead of comparing it to a fixed value. How can I do that ?
 
  Thanks
  BS
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

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



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


RE: Select Property !

2003-12-03 Thread Fullam, Jonathan
You are referencing modelYear as the property but your baseVO appears to
have a property called strModelYear.

-Original Message-
From: Rama, Shreekantha (K.) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 11:04 AM
To: Struts Users Mailing List
Subject: Select Property !
Importance: High


Hi All, 

I have the following piece of code in a .jsp

html:select property=baseVO.modelYear size=1
  html:optionsCollection property=baseAbstractVO.modelYearList
value=modelYear label=modelYear/
  /html:select

I am getting the error as : 

[No getter method available for property modelYear for bean under
name 2002]: javax.servlet.jsp.JspException: No getter method available for
property modelYear for bean under name 2002
at
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollect
ionTag.java:273)


My baseVO class has these methods

/**
 * Gets the fieldNo
 * @return Returns a String
 */
public String getModelYear() {
return strModelYear;
}

/**
 * Sets the strModelYear
 * @param strMdlYr The strModelYear to set
 */
public void setModelYear(String strMdlYr) {
this.strModelYear = strMdlYr;
}



/**
 * Gets the ModelYearList
 * @return Returns an arraylist
 */
public ArrayList getModelYearList() {
return ModelYearList;
}

/**
 * Sets the ModelYearList
 * @param ModelYearList The ModelYearList to set
 */
public void setModelYearList(ArrayList listArray) {
this.ModelYearList = listArray;
}


What is the mistake I have done. 


Thanks  Regards
Shree


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


RE: Variable value in logic:equal tag Help Req [SOLVED]

2003-12-03 Thread Fullam, Jonathan
told ya so...  ;-)

-Original Message-
From: Shakti [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 11:35 AM
To: Struts Users Mailing List; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Variable value in logic:equal tag Help Req [SOLVED]


Hey that % refVar.toString % worked man .. :-) ... at last. . now i won't
have to sit for the whole nite .. :-) ..
chao ..
Shakti

- Original Message -
From: Shakti [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 9:52 PM
Subject: Re: Variable value in logic:equal tag Help Req


 Hi ,
 I am still not able to make out as how can i compare values from two
 arraylists using logic iterate and logic equal , as none of them is a
 constant and i am still getting the same error.
 1) I want to know how do i get the value of the variable created using
 bean:define ??? I am using %= var % but i am not getting it .. plz help
.

 Plz help me out of this .
 Thanks
 Shakti
 - Original Message -
 From: Fullam, Jonathan [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Wednesday, December 03, 2003 9:30 PM
 Subject: RE: Variable value in logic:equal tag Help Req


  You can use a variable for the value attribute just as you did:  %=
  refValue % as long as refValue is a variable in some scope on your
page.
  Note that refValue must point to a String object because the equal tag
  requires this (it converts the value of the bean pointed to by the name
  attribute to a String for comparisons).  If refValue is not a String you
 can
  try the following %= refValue.toString() %.
 
  -Jonathan
 
  -Original Message-
  From: Shakti [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 03, 2003 10:27 AM
  To: Struts Developers List; Struts Users Mailing List
  Subject: Variable value in logic:equal tag Help Req
 
 
  With reference this mail :
  I trid this code but i am getting the error :can not resolve symbol
 refValue
 
 :\bea\user_projects\mydomain\myserver\.wlnotdelete\mcc_mcc_4346456\jsp_ser
vl
  et\__reassignta.java:376: cannot resolve symbol
  probably occurred due to an error in /reassignta.jsp line 118:
  logic:equal name=reassignedTaId value=%= refValue % 
 
  I want to compare values from one arraylist with another using logic
equal
  tag but in the value= tag how i can give a variable ??
  Plz Help !!!
  Thanks  Regards,
  Shakti
 
 
 
  - Original Message -
  From: Nicolas De Loof [EMAIL PROTECTED]
  To: Struts Developers List [EMAIL PROTECTED]
  Sent: Monday, November 24, 2003 4:38 PM
  Subject: Re: variable value in logic notEqual tag
 
 
   Use this :
  
   bean:define id=refValue name=beanRef property=foo/
   logic:equal name=beanToCompare property=bar value=%= refValue
%
 
   ...
   /logic:equal
  
  
   Nico.
  
   - Original Message -
   From: Baljinder Singh [EMAIL PROTECTED]
   To: Struts Developers List [EMAIL PROTECTED]
   Sent: Monday, November 24, 2003 12:03 PM
   Subject: variable value in logic notEqual tag
  
  
Hi All,
   
I want to compare the variable in notEqual tag to value of another
  variable
instead of comparing it to a fixed value. How can I do that ?
   
Thanks
BS
   
   
  
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 

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



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


RE: Session Scope ActionForm, ActionErrors and the Back Button

2003-12-02 Thread Fullam, Jonathan
John,
ActionErrors is stored under the key: Globals.ERROR_KEY.  You can implement
your ActionForm reset (which is called on all ActionForm objects on every
request) method to remove the ActionErrors found under this key from your
Request or Session.

Jonathan

-Original Message-
From: John Topley [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 1:31 PM
To: [EMAIL PROTECTED]
Subject: Session Scope ActionForm, ActionErrors and the Back Button 


My application has a sequence of pages that submit to a single ActionForm
with
session scope. The problem I have is that if the user clicks the Back button
any
previous ActionErrors are still displayed, even though the form fields may
be
populated with valid values.

Is it possible to specify a session scope ActionForm with request scope
ActionErrors? How can I solve this problem? I really want to keep the
ActionForm
in the session.

I've searched this list but didn't find any solutions.

Thanks in anticipation,

John



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


Re: links without underline/border

2003-11-24 Thread Jonathan Sampson
Sonam, You do not want to kill a text-decoration simply because images do
not have text decorations.
Instead, on your image add this property

border=0 So your image tag should be:

img src=../../images/save_journal.gif border=0/

I hope this helps. You can delete the style tag all together.

- Original Message -
From: Sonam Belbase [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, November 24, 2003 1:38 PM
Subject: links without underline/border


 I'm trying to get the image be a link and not be underlined, but the
 following still
 renders an image with with a border.

 html:link href=javascript:setSaveUrl('save');
 style={text-decoration: none;}  
  img src=../../images/save_journal.gif/
 /html:link

 If anyone can tell me how I can get the link image to display just on
 it's own,
 I'd appreciate it.

 Thanks,
 SB

 --
 NOTICE: If received in error, please destroy and notify sender.  Sender
 does not waive confidentiality or privilege, and use is prohibited.



 -
 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: Token documentation

2003-11-21 Thread Fullam, Jonathan
I found the description of how and when to use tokens in The Struts
Framework, Practical Guide for Java Programming by Sue Spielman very
useful.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 11:19 AM
To: [EMAIL PROTECTED]
Subject: Token documentation



Hi all,

I have problems with the refresh button of my brower: it resend
automatically the form to the server.
I found the mailing archive that with the use of tokens, I can avoid that.
But I don't really understand how I have to use it properly.
Can someone tell me when i could find a good documentation concerning this
point? Is it a recommanding desing to associated with tokens ?

thanks,

Ludo.







This message and any attachments (the message) is intended solely for the
addressees and is confidential. 
If you receive this message in error, please delete it and immediately
notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole or partial, is
prohibited except formal approval. 
The internet can not guarantee the integrity of this message. BNP PARIBAS
(and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

-

Ce message et toutes les pieces jointes (ci-apres le message) sont etablis
a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce message par erreur,
merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce message non conforme a
sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation
expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales)
decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.


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


Error Handling without using errorPage directive

2003-11-05 Thread Jonathan Gordon
Hello all,

I'd like to handle any and all exceptions handled thrown by my JSP pages 
declaratively, ideally using global-exceptions in struts-config. 
Currently, I have a JSP page called by a tile that uses the JSTL Tag 
Library.  Using the c tag I perform a check like this:

c:if test=${!empty featuredProductView.title}
... do some work ...
/c:if
If the method getTitle() throws an exception, I currently see the 
following on the screen:

-- snip --
javax.servlet.ServletException: javax.servlet.jsp.JspException: An error 
occurred while evaluating custom action attribute test with value 
${!empty featuredProductView.title}: An error occurred while getting 
property title from an instance of class 
com.mandaladesigns.apps.commerce.framework.view.FeaturedProductView 
(com.mandaladesigns.common.exceptions.MandalaException)
-- snip --

This also appears in the tomcat localhost log along with the stack 
trace.  But what's really interesting to me is the data I placed in 
com.mandaladesigns.common.exceptions.MandalaException, which is my own 
exception type that subclasses RuntimeException.  Though explicitly 
using an errorPage directive in the page works, I'd like to avoid having 
to place an errorPage directive in all of my JSP files.

So, is there a way that I can place a directive, either in web.xml or 
struts-config.xml that will handle these exceptions?  It seems that 
using error-page in web.xml and global-exception in 
struts-config.xml directives are not consulted for this situation.  I've 
created entries for every type of exception that seems relevant in both 
places but they don't seem to be getting called.

Thanks for your help,

Jonathan.

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


Struts, Tomcat And Performance

2003-11-04 Thread Jonathan Holloway
Does anybody have any information, case studies or figures they can share on the 
performance of struts under tomcat.  

Whats the maximum number of simultaneous users that can be supported by a single 
tomcat instance running struts?  I've got up to around 40-60 but need to increase this 
to more like 150-200 simultaneous users.  

Any help would be greatly appreciated.

Thanks,
Jon.



Need a new email address that people can remember
Check out the new EudoraMail at
http://www.eudoramail.com

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



JSP Expression inside Struts html:text property

2003-10-13 Thread Jonathan Hawkins
Howdy -

I have some JSP code that looks like this:



% for(int x=1;x =7;x++){ %
html:text property=person%=x% value=/
% } %
of course I was expecting the HTML output to be something like:

input type=text name=person1 value=
input type=text name=person2 value=
input type=text name=person3 value=
input type=text name=person4 value=
input type=text name=person5 value=
input type=text name=person6 value=
input type=text name=person7 value=
Instead I am getting :

input type=text name=person%=x% value=
input type=text name=person%=x% value=
input type=text name=person%=x% value=
input type=text name=person%=x% value=
input type=text name=person%=x% value=
input type=text name=person%=x% value=
input type=text name=person%=x% value=
Anyone have another way to achieve the desired output? I looked into 
the html:logic tag and think that may be the way to go, but I can't 
find an example
Please helpsuper powers..failing.must .stop 
evilbad code before it'stoo late

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


Multipage JDBC result

2003-09-16 Thread Jonathan Hawkins
Howdy,
Any tips as to where I can find code examples of how to break down a 
large JDBC result
into say 25 rows per page?

Jon Hawkins

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


[ANN] FreeMarker 2.3pre13 available

2003-09-04 Thread Jonathan Revusky
Greetings,

I'm making this announcement because I consider that it is of general 
interest to Struts users who are investigating other view technologies 
(i.e. alternatives to JSP).

A new preview release of FreeMarker 2.3 is available. Though it's a 
preview, at this point, FM 2.3 is really approaching its final state.

FreeMarker is a well known template engine written in 100% pure Java. It 
is used as a component in various web application frameworks, such as 
JPublish, Niggle, Open for Business, and Tammi. Also, FreeMarker can be 
configured for use as the view layer for model 2 web frameworks, of 
which Struts is the best known example. Here is a link to the manual 
page that explains how to configure FreeMarker for use in conjunction 
with Struts:

http://freemarker.org/docs/pgui_misc_servlet.html

With the 2.3 release cycle, FreeMarker continues to get better. 
FreeMarker 2.2 introduced clean support for JSP taglibs. One user raved 
that he was amazed that it was actually simpler and more straightforward 
to use JSP taglibs from FreeMarker templates than from JSP's! What this 
means, of course, is that Struts users can migrate from JSP-FM without 
losing any investment they may have in JSP taglibs (their own or from 
third parties.)

In FreeMarker 2.3, the new visit and recurse directives may well make it
easier to do recursive XSLT-style transformations in FreeMarker than 
with XSLT itself!

FM 2.3 also adds some other appealing new features, such as the ability
to use variable interpolations in string literals, and the ability to
define functions with return values in the template language.
In short, for those of you who are open to making your lives simpler by
finding more usable alternatives to better-known (and more widely-hyped)
technologies such as JSP and XSLT, FreeMarker really deserves some
serious attention.
For more information, visit http://freemarker.org/ (or
http://freemarker.sourceforge.net/)  or the FreeMarker project page at
http://sf.net/projects/freemarker .
Best Regards,

Jonathan Revusky



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


RE: Formatting form data inside the *view* (JSP's)

2003-08-28 Thread Jonathan Lehr
Hi Sasha,

An alternative approach would be to create a generic mechanism to
populate the ActionForm with properly formatted string values. The idea
here is to write a method that transfers values from a bean to an
ActionForm, automatically applying default type conversion and
formatting based on the bean's property types. Another method can be
added to provide a way to override the default formatting behavior.

I write about this subject extensively in my book Jakarta Pitfalls
(Wiley). Chapter 2, ActionForms, begins with this problem and its
solution. Later sections in the same chapter show how to extend the
mechanism to automatically validate inbound request values (without the
need for declarative specification), and then populate the JavaBean
with converted values using the inverse of the formatting scheme.

The value of this approach is that you don't have to encode the
formatting logic in your JSPs at all. All the formatting code is in one
place, and new JSPs automatically get the formatting behavior without
adding any new code. It helps ensure consistency too, especially if you
have a lot of pages/developers.

A free, downloadable implementation is provided in the example
solutions for Chapter 2, at
http://www.wiley.com/compbooks/dudney/jakarta/index.html under the
Chapters 2,3,4 link.

I'm a bit puzzled that you say that you can't get the user's locale in
your ActionForm. I would think you should be able to do something like
this in your Action to get the locale and set it on the form instance:

public ActionForward execute(...) {
...
Locale currLocale = (Locale) 
request.getSession().getAttribute(Globals.LOCALE_KEY);
form.setLocale(currLocale);
...
}

Jonathan


 -Original Message-
 From: Sasha Borodin [mailto:[EMAIL PROTECTED]
 Sent: August 27, 2003 8:43 AM
 To: Struts Users Mailing List
 Subject: Formatting form data inside the *view* (JSP's)


 Thought I'd throw this out in the middle of the week again...

 Kind of a conceptual question:  how do you format Dates, Numbers,
 Currencies, etc. for *form fields* inside the JSP?

 I know I could do in in the ActionForm getters, but:
 1.  I don't know the locate of the user at that point
 2.  I'd have to recompile the ActionForm every time I want to 
make a
 change to the *view* - seems like a bad practice.

 What I'm looking to achieve is something similar to fmt:format JSTL

tag,
 where you can specify a format mask, or even a format style defined
 elsewhere.

 Thanks,

 -Sasha

 On 8/22/03 12:30, Sasha Borodin [EMAIL PROTECTED] wrote:

  I would like to state a basic assumption I deduced in learning
 struts, then
  pose a question.
 
  Assumption:  ActionForm property getters and setters should
 return and take
  Strings.
 
  My initial impulse was to try passing the actual data types
 (Dates, Numbers,
  etc.); however, the Struts mechanism seems to pass Strings to
 the ActionForm
  setter methods on form submission (which throws a conversion
 Exception of
  course). Then I tried making the setters take Strings, and
 getters return
  the actual data types, but this seemed to confuse the introspection
  mechanism; plus I didn't see any way to apply formatting inside the
  html:text tags (like you can in JSTL's fmt:format tags).
 
  Question:  How does one handle formatting data (custom
 formatting or i18n)
  for (pre/re)population of a form?
 
  Ex.:  An update form; a user's information is loaded from the
 database into
  classes (Strings, Dates, Numbers, etc.).  If you want to format
 this data,
  you have to do it in the Model, as the ActionForm only takes and 
gives
  Strings - which seems to be a Bad Practice.  Even if you had 
additional
  special setters for the explicit purpose of populating the
 ActionForm from
  original data types, you still don't know what Locale the
 client is from.
 
  Is my assumption incorrect?  Is there a basic flaw in my
 understanding of
  the use of ActionForm?  Or there an actual short-coming, and 
workaround?
 
  In short, How Can You Format Data For Strut's Form Tags Inside
 The Actual
  JSP :-) ?
 
  Thank you for any input.
 
  -Sasha

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Anchor tags in a page

2003-06-26 Thread Jonathan Holloway
Hi,

I have a page that is quite large so i'm trying to put anchor a tags in the page so 
that i can redirect the user to a specific part of the page.  this is quite easy to 
achieve so I'm told using the following piece of code in the struts-config.xml file:

action  path=/action
type=org.me.myAction
name=addNewAorB
scope=request

   forward name=addA 
path=/a.jsp#addA/

/action

This will take me to the addA anchor tag in the page provided redirect is set to true.

The problem I have is that I'm using tiles.  Does this prevent me from doing the 
above?  If so is there any way around this?

Many thanks,
Jon.


Need a new email address that people can remember
Check out the new EudoraMail at
http://www.eudoramail.com

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



Message resource question

2003-06-09 Thread Jonathan Hodges
Hello,
 
Is there any way to specify a path for the message resources that isn't
in the classpath (e.g. WEB-INF/classes directory)?  I was wanting to
move it to a directory like WEB-INF/config if possible.
 
Thanks,
 
Jonathan Hodges


[ANN] FreeMarker 2.3pre2 available

2003-06-04 Thread Jonathan Revusky
Greetings,

I'm making this announcement because I consider that it is of general 
interest to Struts users who are investigating other view technologies 
(i.e. alternatives to JSP).

A second preview release of FreeMarker 2.3 is available. FreeMarker is
a well known template engine written in 100% pure Java. It is used as a
component in various web application frameworks, such as JPublish,
Niggle, Open for Business, and Tammi. Also, FreeMarker can be configured
for use as the view layer for model 2 web frameworks, of which Struts
is the best known example. Here is a link to the manual page that 
explains how to configure FreeMarker for use in conjunction with Struts:

http://freemarker.org/docs/pgui_misc_servlet.html

With the 2.3 release cycle, FreeMarker continues to get better. 
FreeMarker 2.2 introduced clean support for JSP taglibs. One user raved 
that he was amazed that it was actually simpler and more straightforward 
to use JSP taglibs from FreeMarker templates than from JSP's! What this 
means, of course, is that Struts users can migrate from JSP-FM without 
losing any investment they may have in JSP taglibs (their own or from 
third parties.)

In FreeMarker 2.3, the new visit and recurse directives may well make it
easier to do recursive XSLT-style transformations in FreeMarker than 
with XSLT itself!

FM 2.3 also adds some other appealing new features, such as the ability
to use variable interpolations in string literals, and the ability to
define functions with return values in the template language.
In short, for those of you who are open to making your lives simpler by
finding more usable alternatives to better-known (and more widely-hyped)
technologies such as JSP and XSLT, FreeMarker really deserves some
serious attention.
For more information, visit http://freemarker.org/ (or
http://freemarker.sourceforge.net/)  or the FreeMarker project page at
http://sf.net/projects/freemarker .
Best Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/


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


Actions, forwards and little old anchor

2003-06-03 Thread Jonathan Holloway
Hi,

I'm trying to forward to an anchor within a page frmo the struts-config.xml file.  
Now, I understand I can do this as follows:

forward name=finishadd  
 path=main.jsp#the_marker 
 redirect=true/

The anchor is definately defined in the page.

The problem is that I'm using tiles and main.jsp looks like:

%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

tiles:insert page=/template.jsp flush=true
 tiles:put name=header value=/header.jsp /
 tiles:put name=menu   value=/menu.jsp /
 tiles:put name=content value=/content.jsp /  
/tiles:insert 

I'm assuming the reason why it's not working is because it can't find the tag in 
main.jsp because it resides in content.jsp.

Is there any way to resolve this?

Thanks,
Jon.


Need a new email address that people can remember
Check out the new EudoraMail at
http://www.eudoramail.com

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



Re: Struts Velocity

2003-06-02 Thread Jonathan Revusky
Met @ Uber wrote:
Could anyone point me towards some good resources on using struts and
velocity together?  I get the general idea, it replaces JSP, but how do
I set it up within my struts actions (and anywhere else needed for use
within struts)?
I know this isn't precisely what you're asking for, but if you're 
interested in replacing the use of JSP with a template engine, you might 
consider FreeMarker, which is a template engine like Velocity, but more 
powerful, and more actively developed and maintained currently.

FreeMarker integrates quite well with Struts. Here is the appropriate 
manual section.

http://freemarker.org/docs/pgui_misc_servlet.html

One major advantage of FM is that 3rd party JSP taglibs are supported 
from within FreeMarker templates. So, basically, you get your cake and 
eat it too. If there is some really cool JSP taglib that does something 
you need, you don't lose the ability to leverage that by opting for FM 
over JSP.

Anyway, I hope that's helpful.

Best Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/


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


Login

2003-05-31 Thread Jonathan Holloway
Could somebody tell me what the best way to implement a login mechanism is into a 
Struts application.  

Is the use of a custom login tag at the top of every page recommended or is there a 
better way.  We already have the server side functionality present but want to know 
the best way to enforce this in the JSP's and Action classes.

Many thanks,
Jonathan Holloway.


Need a new email address that people can remember
Check out the new EudoraMail at
http://www.eudoramail.com

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



ANN] Struts-FreeMarker-JSP taglibs integration

2003-04-02 Thread Jonathan Revusky
Folks,

The first release of FreeMarker 2.2 labeled production/stable is 
available. FreeMarker 2.2 may be of special interest to Struts users 
because it is the first template engine, to our knowledge, that supports
the usage of 3rd party JSP taglibs. This means that you can have the 
cleanness and simplicity of a template engine like FreeMarker without
giving up the ability to use powerful 3rd party JSP taglibs like Cewolf
or SiteMesh and so on. You have the best of both worlds!

See http://freemarker.org/docs/pgui_misc_servlet.html for more details 
about how to configure Struts for use with FreeMarker. There is also an 
example of struts usage in the distro.

For those who don't know it, FreeMarker is a well-known, tried-and-true 
tool for doing page templates in Java. In practice, it is mostly used 
in the web space to get data from servlets into HTML pages.

Aside from the ability to use JSP taglibs, FreeMarker 2.2 introduces a
host of powerful new features. Here is a not-necessarily exhaustive 
list:

namespaces -- macro libraries can be defined in separate namespaces so 
that different people can work on different pieces without any
possibility of naming clashes. For more details, see: 
http://freemarker.org/docs/dgui_misc_namespace.html

fine control of whitespace -- this has been the bane of template
engines and a constant subject on mailing lists. We think we've really
nailed this problem now. For more details, see: 
http://freemarker.org/docs/dgui_misc_whitespace.html

more powerful macros -- Macros can defined with default parameters, and
can be invoked with optional body content. For more details, see: 
http://freemarker.org/docs/ref_directive_macro.html

Simplified syntax -- Macros and transforms are now invoked with a common
syntax, so, despite the increased power, FM 2.2 is actually
substantially simpler! For more details, see: 
http://freemarker.org/docs/ref_directive_userDefined.html

clean interoperability with jython -- Of special interest to python 
fans, jython objects can be used transparently from within FreeMarker 
templates. For more details, see: 
http://freemarker.org/docs/pgui_misc_jythonwrapper.html

Okay, 'nuff said, I guess. If that doesn't pique your interest, I don't 
know what will.

Enjoy,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Available for java/internet consulting
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Getting the id of an object in the value tag

2003-04-01 Thread JONATHAN PHILIP HOLLOWAY
I wonder whether someboyd knows how to do the following:

If I have:

html:radio value=2 property=answer/

How do i change this so the value tag takes the id from a bean instead of 2

Is it like this:

html:radio value= bean:write id=AnswerBean property=answerId/  
property=answer/

Or is there another way of doing it?

Thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Login

2003-03-24 Thread Jonathan
Can somebody tell me if the following is possible.  I want to authorise
a user
And passing the username and password from Struts is easy enough and the

Authorisation on the EJB side of things is simple enough.  However, what
I
Retuirn is a login object specifying the username.  Should I simply be
storing 
This in the session?  If so will this mean that this object will remain
there until:
 
1. The session times out
2. I clear the session
 
I want to be able to access the login object at ALL times.  Will it be
available
no matter what?
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


Nested Radio Buttons + Mutual Exclusion

2003-03-13 Thread Jonathan
Does anybody know how to use the nested:radio button component so
That you can have mutually exclusive sets of radio buttons?
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


Mutually Exclusive Radio Buttons

2003-03-12 Thread Jonathan
I wonder whether somebody could help me out here.
 
I'm trying to create a number of radio buttons that have to be mutually
exclusive.
 
I know that its possible just by setting the property to be the same
value for all
but what if I'm using a nested:iterate tag?  Surely this will result in
the property
being different for each of them because of the nested index, e.g. like
 
property=Banana[0].ripe
 
Rather than just:
 
property=ripe
 
which would allow mutual exclusion.  Is there any way around this,
 
Many thanks,
Jon.
 
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


Sessions Again (Last Time)

2003-03-07 Thread JONATHAN PHILIP HOLLOWAY
Ok can somebody clarify this, I have one JSP that uses two actions,
If I use Action A exclusively then only one session will be used but if
I try to use Action B from the same JSP will a new session be
created?

Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


RE: Problem with Monkey examples

2003-03-05 Thread Jonathan
I've got the monkey complex example workign with Tomcat 4.1.18 using
Struts 1.1b2 but it was a pain in the arse to get working, if you 
need the file then you can download it from

http://users.aber.ac.uk/jph8/monkey.war

Hope that's of some help to you people working with the nested tags.

Monkey monkey monkey,
Jon.

-Original Message-
From: Becky Norum [mailto:[EMAIL PROTECTED] 
Sent: 05 March 2003 16:55
To: Struts Users Mailing List
Subject: RE: Problem with Monkey examples

The MonkeyTree example didn't work for me in Tomcat 4.1.18 - I went back
down to 4.0.6 and it worked fine.

-- 
Becky Norum
Database Administrator
Center for Subsurface Sensing and Imaging Systems (CenSSIS)
Northeastern University
http://www.censsis.neu.edu


On Wed, 2003-03-05 at 11:21, Pellier, Marc wrote:
 I have the same problem tomcat 4.1
 
 -Original Message-
 From: Margarita Manterola [mailto:[EMAIL PROTECTED]
 Sent: mercredi 5 mars 2003 15:42
 To: Struts Users Mailing List
 Subject: Problem with Monkey examples
 
 
 Hi!
 
 I'm a newbie, trying to get a taste of struts.  I'm using Tomcat 3,
and
 I've put all the struts libraries and jars in the apps folder, so
that
 all the apps have access to them.
 
 The struts applications (documentation, templates, etc) seem to be
 working fine. However, I've downloaded the monkey examples and
deployed
 them, but I cannot use them :(.  I'm getting Cannot find
ActionMappings
 or ActionFormBeans collection.
 
 I've read that this error is due to problems in the struts-config.xml,
 but I haven't changed any of them, I've checked the xml tags and they
 all seem fine to me.
 
 Is there something else that might be causing this error? 
 
 Thanks,
 Margarita.
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 Disclaimer: 
 This electronic transmission and any files attached to it are strictly

 confidential and intended solely for the addressee. If you are not 
 the intended addressee, you must not disclose, copy or take any
 action in reliance of this transmission. If you have received this 
 transmission in error, please notify the sender by return and delete
 the transmission.  Although the sender endeavors to maintain a
 computer virus free network, the sender does not warrant that this
 transmission is virus-free and will not be liable for any damages 
 resulting from any virus transmitted. 
 Thank You.



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




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



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



Nested problem not finding the id

2003-03-04 Thread JONATHAN PHILIP HOLLOWAY
I'm currently using a nested:form part inside a nested:iterate loop
to display a number of different items along with a corresponding 
edit and delete button for each item.  The problem I have is that
I can't refer to the id of the item using:

nested:hidden property=addressId/

Could somebody tell me why it's looking for the addressId in my
initial person form instead of the nested Address object which
is contained with an arraylist in person, i.e.

PersonForm
Arraylist addressList

where addressList is of type person.

I get the following error message.

ServletException in:/person/addperson.jsp] 
No getter method for property addressId of bean Personform

This is the following code segment, note that the nested:write
tag locates the address object correctly but the nested:hidden
tag within the nested:form tag does not.  Do I need to use
nested:root or something?

nested:iterate property=addressList scope=session

  tr  
  td class=listtextnested:write property=addressId//td   
 
td class=listtextnested:write property=addressText//td   
 
   
td
   
nested:form action=/addperson scope=session
  
nested:hidden property=addressId/
   
  nested:submit property=action
  
 bean:message key=button.edit/ 

   /nested:submit 
  
/nested:form 
  
  /td  
   
td

   nested:form action=/addperson scope=session

 nested:hidden property=addressId /
   
   nested:submit onclick=return 
confirm('Confirm Delete?'); property=action
   
 bean:message 
key=button.delete/  
  
  
/nested:submit   
 
   
/nested:form  
 
/td   

  /tr 
   
/nested:iterate

Many thanks in advance,

Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


RE: J2EE and Tomcat and struts (Question re Struts in Action by Husted)

2003-03-04 Thread Jonathan
Tomcat is an implementation of the servlet spec that is part 
of the J2EE architecture.  You should be able to include the
jar files that are in tomcat as part of your classpath in
order to compile your servlets.

Jon.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 05 March 2003 01:21
To: [EMAIL PROTECTED]
Subject: J2EE and Tomcat and struts (Question re Struts in Action by
Husted)

The book has no discussion about installing J2EE when installing Tomcat.
Yet, on page 20, Listing 1.2, RegisterAction.java imports the package
javax.servlet.http.*.  Is'nt that package part of J2EE?  How is this
going to compile and work if no J2EE is installed?  I haven't gotten far
enough to compile this yet because I am still stuck on trying to figure
out what is UserDirectory (in the same listing).
I would appreciate an explanation.
Thanks.

__
The NEW Netscape 7.0 browser is now available. Upgrade now!
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/

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



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



URL Rewrite Cookies

2003-03-03 Thread Jonathan
I'm still having problems with sessions here but I've kind of narrowed
it down now.
if I have a html:link tag in a page that is currently using Session A
will it still
use the same session if I use that link to get to another page? I'm
assuming
it uses URL rewriting instead when using html:link which is why the
session ID
changes when I look at the debug information on the Struts side.  Can
anybody
shed some light here?
 
My link by the way goes through the same action (instead of linking to
another page)
which simply returns a forward to the correct page.  
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


Nested Bug?

2003-03-03 Thread JONATHAN PHILIP HOLLOWAY
Could somebody tell me whether the followign line is an error
for the indexed=true property of the nested tags?  The number
value seems to be outside the quotes,

td
   input type=submit name=action[0] value=Edit
/td
 
td
input type=submit name=action[0] value=Remove  
 
/td  

Note that this is the code generated from:

nested:iterate property=addresses

td
 html:submit property=action indexed=true
  
  bean:message key=address.edit/   

 /html:submit
  /td
  
td
 html:submit property=action indexed=true
  
  bean:message key=address.remove/ 
 
 /html:submit   
/td   

  /tr  
  /nested:iterate

This doesn't seem right to me, I haven't looked at the source code
yet but please somebody correct me if I'm wrong.

Jon.




*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Iterate + indexed property arghhh....

2003-03-03 Thread Jonathan
Hello,
 
I wonder whether somebody can help, I'm using the logic iterate tag to
loop through a number
of items producing a delete button for each of the items.  When the
delete button is
clicked I want to delete that particular item.  Using the below:
 
html:submit indexed='true'  onclick=return confirm('Confirm
Delete?');  property='action'
bean:message key=questionoption.button.delete/

/html:submit  
 
I produce a list of buttons which SHOULD appear like follows:
 
input type=submit name=action[0] value=Delete
input type=submit name=action[1] value=Delete
input type=submit name=action[2] value=Delete
 
but instead the name appears like this:
 
input type=submit name=action[0]  value=Delete   
 
With [0] being outside the bracket.
 
Can anybody tell me why this is?  Does it make a difference if I use '
to enclose the values
or whether I use  to enclose the values.  It would seem that it does so
does anybody know
the EXACT syntax for specifying a HTML submit button?  Should I be using
a nested:submit
component?  Does that really make any difference?
 
Also on the server side how would I catch which button has been pressed?
I can't use:
 
String action = (String)request.getParameter(action);
 
Because the index causes a problem,
 
Many thanks in advance for any help or tips you can provide me with,
this seems to be the last
part of my problems.
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


Sessions

2003-03-02 Thread Jonathan
O  action path=/addperson 
  type=com.examplePersonAction 
  name=PersonForm
  input=/person/addperson.jsp 
  scope=session 
  validate=true 
  parameter=action
 
  forward name=addperson path=/person/addperson.jsp / 
  forward name=addaddress path=/person/addaddress.jsp / 
  forward name=success path=/person/mainmenu.jsp / 
 
  /action
 
Ok last question on session, could somebody tell me if the above should
all be retained in the same session?  Also will the same action form
be used?   The first page accessed here is addperson.jsp, this page
has a link back to this mapping which forwards the user to the
addaddress.jsp
where they can enter an address and are then returned to the main page
where they can view the list of addresses that they have currently
entered.
Is this correct?
 
Many thanks,
Jon.
 
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


Sessions

2003-02-28 Thread JONATHAN PHILIP HOLLOWAY
Does anybody know when a new session is started?
Is it in any of the following:

1. When a new action is selected?
2. When a new page is linked to on the client side?
3. When a page is returned to via an action forward?

Also when is a new actionform created? Is it for every request to a new mapping? 
If the scope is set to session should it last throughout the user session no matter 
what mapping or action the user is currently using?

In general how do sessions work within Struts, can somebody please please
pretty please provide me with a brief overview or link to some information.

Many thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Session Problems

2003-02-27 Thread JONATHAN PHILIP HOLLOWAY
Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of addresses
as shown below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page,
this JSP allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned
tot he first page where the new address is shown in the list of addresses.
the problem I have is that when I add a second address it removes the
first address and only the second address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please explain to
me why this happening.  I have set the scope to session for both JSP pages and
both JSP pages use the same action form so why is this happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


RE: Session Problems

2003-02-27 Thread Jonathan
The form bean is simply a standard action form, when its created
It simply does the following in the constructor

public PersonForm() {

addresses = new ArrayList(20);  
}

To get the addresses and iterate through them I simply have:

/**
 * Get Addresses
 */
public Object[] getAddresses() {
return (this.addresses.toArray()); 
}

When the second form is submitted the following method is called
In the AddAddressAction via the lookup dispatch action:

public ActionForward addAddress(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
  HttpServletResponse response)
throws Exception {



//Check that the token is valid, if it is then reset it
if(isTokenValid(request)) {

System.out.println(Token is valid, resetting
the request);
resetToken(request);
}   
else {
System.out.println(Token is invalid);
}


//Get the action form
PersonForm personForm = (PersonForm)form;   

int addressId = (personForm.getNumberOfAddresses() + 1);

System.out.println(New id is  + generatedId);

//Create the question option from the buffered values
Address address = new Address (generatedId, new
String(address));




//Add the question option to the action form
personForm.addAddress(address);  


//Save a token for this request to prevent automatic
refreshing
//from submitting the request again
System.out.println(Saving the token);
saveToken(request);

 //Now the address has been added return to the add person page

return (mapping.findForward(addPerson));
}   

The address is added but the next time I try to add an address to old
one
Is overwritten..

Jon.



-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 18:54
To: Struts Users Mailing List
Subject: RE: Session Problems

Can you summarize the form bean you are using for the first page?  What
are its properties?  How is the Collection maintained?  How is the bean
being created?

Sri

-Original Message-
From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 12:01 PM
To: Struts Users Mailing List
Subject: Session Problems


Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of
addresses as shown below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page,
this JSP allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned
tot he first page where the new address is shown in the list of
addresses. the problem I have is that when I add a second address it
removes the first address and only the second address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please
explain to me why this happening.  I have set the scope to session for
both JSP pages and both JSP pages use the same action form so why is
this happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*

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

RE: Session Problems

2003-02-27 Thread Jonathan
Umm in my constructor in the actionform I have:

public PersonForm() {

address = new Address(20);  
}

-Original Message-
From: Phillip Qin [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 18:57
To: 'Struts Users Mailing List'
Subject: RE: Session Problems

When you set your collection, do you use
mycollection.addAll(newcollection)
or collection = newcollection?

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

-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED] 
Sent: February 27, 2003 1:54 PM
To: Struts Users Mailing List
Subject: RE: Session Problems

Can you summarize the form bean you are using for the first page?  What
are
its properties?  How is the Collection maintained?  How is the bean
being
created?

Sri

-Original Message-
From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 12:01 PM
To: Struts Users Mailing List
Subject: Session Problems


Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of
addresses
as shown below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page,
this
JSP allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned
tot he
first page where the new address is shown in the list of addresses. the
problem I have is that when I add a second address it removes the first
address and only the second address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please
explain to me why this happening.  I have set the scope to session for
both
JSP pages and both JSP pages use the same action form so why is this
happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*

-
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: Searching the Archives?

2003-02-12 Thread JONATHAN PHILIP HOLLOWAY
Try

http://www.mail-archive.com

Instead.. : )

Jon
- Original Message -
From: Jason Vinson [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, February 12, 2003 3:51 PM
Subject: Searching the Archives?


 I feel dumb for asking this, but I am trying to search the list archives
via:


http://nagoya.apache.org/eyebrowse/SearchList?listId=listName=struts-user@j
akarta.apache.orgsearchText=bean+attributesdefaultField=subjectSearch=Sea
rch

 and when i do a search, it returns Text search not available for this
list.  Where should i look for proper archive searching?

 Thanks,
 Jason



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




LookupDispatchAction

2003-02-12 Thread JONATHAN PHILIP HOLLOWAY
Does anybody know why the following is casuing me so many problems.
I'm using LookupDispatchAction and have a number of methods defined
in my action class including an execute method.  The problem is that
the execute method ALWAYS gets executed and not the intended method.

I have in the addbanana.jsp:
html:submit value=Add Banana property=action/

and in Struts-config:
  action path=/addbanana
type=com.example.AddBananaAction
name=BananaForm
input=/addbanana.jsp
scope=session
parameter=action 
  
   /action

In my action class I've defined the following:

public ActionForward addBanana(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
HttpServletResponse response) throws 
IOException, ServletException {
 

  return (mapping.findForward(success));
 }

public ActionForward deleteBanana(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
HttpServletResponse response) throws 
IOException, ServletException {
 

  return (mapping.findForward(success));
 }
 
/**
 * Get key method map just obtains the map that maps the button
 * text onto the particular method in this action
 * @param mapping is the action mapping
 * @param form is the action form 
 * @param request is the http request
 */ 
protected Map getKeyMethodMap() {
   
   
  Map map = new HashMap();
  map.put(Add Banana, addBanana);
  map.put(Delete Banana, deleteBanana);   
  return map;
 }



  /**
 * Execute method
 * @param mapping is the information regardin gthe URI mapping and the action
 * @param form is the action form used
 * @param request is the request
 * @param response is the response
 * @return the action forward, a destination to forward the user onto (eg another JSP)
 */
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException, 
ServletException {

  
  Logger.logInfo(Execute Called);   
  
  
  
//We can now put these bits in the database
return (mapping.findForward(success)
}


Does anybody know why EXECUTE is called but the intended ADDBANANA method is not
called?

Many thanks,
Jon.



*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



LookupDispatchAction

2003-02-12 Thread Jonathan
Ok the reason I had just put strings in the Map was because of
Lack of internationalisation, I've now done this but still I get
The same error that of a NullPointerException.  I'm assuming this
Is because of a method not found error from my ServletException
Output in Tomcat... (See attached)  Am I correct in assuming that

map.put( button.banana.add, addBanana );

maps onto the method..

public ActionForward addBanana(ActionMapping mapping, 
   ActionForm form, 
   HttpServletRequest request, 
 HttpServletResponse response) throws
IOException, ServletException {


return (mapping.findForward(success));
} 

I've simply stuck super.execute() in my execute method and also
Tried removing the method as well but I still seem to get the 
Following exception *sigh*.  Can anyone suggest whats wrong?

Many thanks,
Jon.

Exception follows..

javax.servlet.ServletException
at
org.apache.struts.action.RequestProcessor.processException(RequestProces
sor.java:507)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:448)
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.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
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.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
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.catalina.core.StandardContext.invoke(StandardContext.java:239
6)
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:40
5)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:380)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:50
8)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:533)
at java.lang.Thread.run(Thread.java:536)


root cause 

java.lang.NullPointerException
at java.lang.Class.getMethod0(Class.java:1734)
at java.lang.Class.getMethod(Class.java:951)
at
org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:3
34)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.j
ava:266)
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:239)
at
tweek.struts.staff.action.assessment.QuestionMCAction.execute(QuestionMC

RE: LookupDispatchAction

2003-02-12 Thread Jonathan
Ok, here goes... I've definately defined the internationalization
Stuff in ApplicationResources.  Note the struts config bit below
And the fact that I've specified the scope as session, does this
make a difference? 


action path=/addbanana
type=com.example.AddBananaAction
name=BananaForm
input=/addbanana.jsp
scope=session
parameter=action 

forward name=success path=success.jsp/

/action 

My JSP has the bit...

html:submit property=action
bean:message key=button.banana.add/

/html:submit

Is this wrong for a submit button?  Should I be specifying a value 
Attribute?  If so how do I pass the bean:message bit in, is it this
instead

html:submit property=action value=bean:message
key=button.banana.add/  
/html:submit


Finally application resources contains...

button.banana.add=Add Banana


Many thanks,
Jon.


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]] 
Sent: 13 February 2003 00:28
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction

 Ok the reason I had just put strings in the Map was because of
 Lack of internationalisation, I've now done this but still I get
 The same error that of a NullPointerException.  I'm assuming this
 Is because of a method not found error from my ServletException
 Output in Tomcat... (See attached)  Am I correct in assuming that
 map.put( button.banana.add, addBanana );
 maps onto the method..
 public ActionForward addBanana(

Not without the following:
   In the .properties file:
  button.banana.add=Add Banana
   In the request
  action being equal to Add Banana
   In struts-config:
  actionpath=/editContact
  ...
  parameter=action

 I've simply stuck super.execute() in my execute method and also
 Tried removing the method as well but I still seem to get the 
 Following exception *sigh*.  Can anyone suggest whats wrong?

This isn't the same error you described earlier... now the
LookupDispatchAction's execute method *is* being executed, but it can't
figure out which method to pick.

You're much closer now, just get all the bits arranged properly and it
will
work.  If you're still stuck, post the relevant snippets of
struts-config,
.properties and the JSP.  We've just seen the map.put and the addBanana
method signature so far.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


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




Adding a new object to a collection in an actionform

2003-02-11 Thread JONATHAN PHILIP HOLLOWAY
Does anybody know how to add a new Object to a collection
that exists in an ActionForm.

public class MonkeyForm extends Actionform {
public ArrayList bananas;

...
...

public void setAddBananaForMonkey(Banana newBanana) {
bananas.add(newBanana)
}
}

I know I can create an empty object just by doing this:

nested:submit onclick=addmonkey.do 
   property=addBananaForMonkey 
   value=Add New Banana For Monkey/

But how do I go about creating a new banana with initialized properties
that come from a nwe form on another page.  Is it possible?
I need the new form because I want the user to enter the details for 
the banana BEFORE it is created as blank in the actionform.  
It would be ideal if I could enter these new details in a popup window 
of some sort but how do I go about doing this,

Many thanks in advance,
Jon Holloway.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Forms and multiple buttons

2003-02-11 Thread JONATHAN PHILIP HOLLOWAY
I've successfully built a page that iterates over a nested arraylist 
displaying the contents of the arraylist in the following way

 ---
| Title | Code | Available? |  Edit  |  Remove  |
|---| 
| rara  | 1220 | X  | Button |  Button  |
| asdd  | 1435 | X  | Button |  Button  |
 ---

In the case of the edit button I want to display an
alternate screen that allows the entry of the 
details (title, code and available).  In the above 
table I just want them to be read only.   I also
want the remove button to remove the selected object
from the ArrayList.

Can anybody tell me how I shoudl go about doing this?

Is it a case of embedding id's in the button and 
manipulating the array list using these ids and 
an action?  If so how do I partition my action
up into various parts to achieve this?  Is it a
simple case of using dispatchAction and passing
the id in the query string?

Many thanks in advance,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: Nesting forms

2003-02-10 Thread JONATHAN PHILIP HOLLOWAY
You don't actually need to create three forms.  All you need to do is to
create one action form
for your top level form, in your case LineItem.  The other two are standard
Java classes, just
make sure they implement Serializable.  You can just refer to these in your
main form in the
following way

LineItem
ArrayList shippingList

then in your Shipping java object just have

Shipping
ArrayList billingList

The code is simple to loop through and display these and it simply involves
sticking nested:iterate
tags in your JSP to loop through the fields within the other objects.

Hope that starts you off, you don't actually need to piss about with the
struts-config.xml file at all
apart from declaring your initial actionform there, hope that helps you out.

Jon.

- Original Message -
From: Jacky Kimmel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 10, 2003 5:16 PM
Subject: Nesting forms



 I need to display data from the database in a jsp.  In order to do this I
have created a form in the struts-config.xml.  My question is on how to nest
forms.  I have the main form, then a lineItem form with item info (there may
be mulitiple line Items), then two address forms: shipping and billing.  How
do I create the overall form in the .xml file?  I am using ejb's for the
database calls.



 -
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now


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




log4j problem

2003-01-30 Thread De Cesco, Jonathan
Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like RequestProcessor Processing a POST
request for path url are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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




RE: log4j problem

2003-01-30 Thread De Cesco, Jonathan
ok but the real problem is that struts logs an INFO each time a request is
processed. My webapp should handle hundreds of simultaneous clients
therefore my personal webapps logs are not visible enough. But thanks
anyway.


-Message d'origine-
De : Pani, Gourav [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:10
À : 'Struts Users Mailing List'
Objet : RE: log4j problem


You may want to increase your default console setting from DEBUG to WARN.
That would eliminate a lot of log messages.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 AM
To: '[EMAIL PROTECTED]'
Subject: log4j problem


Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like RequestProcessor Processing a POST
request for path url are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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

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

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




RE: log4j problem

2003-01-30 Thread De Cesco, Jonathan
Yes I know the originating class that produces logs, it's RequestProcessor.
But I didn't know that log4j could exclude class from the logs. Is it
configurable in the log4j conf file ?
I will look into it, thanks.


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:18
À : [EMAIL PROTECTED]
Objet : RE: log4j problem


Can you see the originating class for all those struts loggings messages in
the 
logged messages?
I mean in log4j ,u can disable the logging per class or package level..And
if 
struts is using log4j, then it must be creating those log4j loggers which 
generally have the class name...So may be u can specify that disable logging

for all loggers of struts classes ..If u can send a few entries from the log

file, I may be able to help..

regards,
Shirish

-Original Message-
From: jdecesco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:15 PM
To: struts-user
Cc: jdecesco
Subject: RE: log4j problem


ok but the real problem is that struts logs an INFO each time a request is
processed. My webapp should handle hundreds of simultaneous clients
therefore my personal webapps logs are not visible enough. But thanks
anyway.


-Message d'origine-
De : Pani, Gourav [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:10
À : 'Struts Users Mailing List'
Objet : RE: log4j problem


You may want to increase your default console setting from DEBUG to WARN.
That would eliminate a lot of log messages.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 AM
To: '[EMAIL PROTECTED]'
Subject: log4j problem


Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like RequestProcessor Processing a POST
request for path url are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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

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

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



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

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




RE: log4j problem

2003-01-30 Thread De Cesco, Jonathan


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:31
À : [EMAIL PROTECTED]
Objet : RE: log4j problem


.U can specify log level per logger as well.SO if u want to exclude logging
for 
some packages,U specify a higher log level for that..some thing like

log4j.logger.org.apache.struts=ERROR

So for all loggers whose name starts with org.apache.struts , only errors
wil 
be logged..For other named hirarchies, it will still not change

-Original Message-
From: gourav.pani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:24 PM
To: struts-user
Subject: RE: log4j problem


i was under the impression that you do exclusion by inclusion.  in other
words, if you specify the package you want logged, it excludes everything
else.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 8:22 AM
To: 'Struts Users Mailing List'
Subject: RE: log4j problem


Yes I know the originating class that produces logs, it's RequestProcessor.
But I didn't know that log4j could exclude class from the logs. Is it
configurable in the log4j conf file ?
I will look into it, thanks.


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:18
À : [EMAIL PROTECTED]
Objet : RE: log4j problem


Can you see the originating class for all those struts loggings messages in
the 
logged messages?
I mean in log4j ,u can disable the logging per class or package level..And
if 
struts is using log4j, then it must be creating those log4j loggers which 
generally have the class name...So may be u can specify that disable logging

for all loggers of struts classes ..If u can send a few entries from the log

file, I may be able to help..

regards,
Shirish

-Original Message-
From: jdecesco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:15 PM
To: struts-user
Cc: jdecesco
Subject: RE: log4j problem


ok but the real problem is that struts logs an INFO each time a request is
processed. My webapp should handle hundreds of simultaneous clients
therefore my personal webapps logs are not visible enough. But thanks
anyway.


-Message d'origine-
De : Pani, Gourav [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:10
À : 'Struts Users Mailing List'
Objet : RE: log4j problem


You may want to increase your default console setting from DEBUG to WARN.
That would eliminate a lot of log messages.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 AM
To: '[EMAIL PROTECTED]'
Subject: log4j problem


Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like RequestProcessor Processing a POST
request for path url are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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

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

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



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

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

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



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

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




RE: log4j problem

2003-01-30 Thread De Cesco, Jonathan
It worked, thank you, my understanding of Log4J was rather limited!!


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:31
À : [EMAIL PROTECTED]
Objet : RE: log4j problem


.U can specify log level per logger as well.SO if u want to exclude logging
for 
some packages,U specify a higher log level for that..some thing like

log4j.logger.org.apache.struts=ERROR

So for all loggers whose name starts with org.apache.struts , only errors
wil 
be logged..For other named hirarchies, it will still not change

-Original Message-
From: gourav.pani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:24 PM
To: struts-user
Subject: RE: log4j problem


i was under the impression that you do exclusion by inclusion.  in other
words, if you specify the package you want logged, it excludes everything
else.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 8:22 AM
To: 'Struts Users Mailing List'
Subject: RE: log4j problem


Yes I know the originating class that produces logs, it's RequestProcessor.
But I didn't know that log4j could exclude class from the logs. Is it
configurable in the log4j conf file ?
I will look into it, thanks.


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:18
À : [EMAIL PROTECTED]
Objet : RE: log4j problem


Can you see the originating class for all those struts loggings messages in
the 
logged messages?
I mean in log4j ,u can disable the logging per class or package level..And
if 
struts is using log4j, then it must be creating those log4j loggers which 
generally have the class name...So may be u can specify that disable logging

for all loggers of struts classes ..If u can send a few entries from the log

file, I may be able to help..

regards,
Shirish

-Original Message-
From: jdecesco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 2:15 PM
To: struts-user
Cc: jdecesco
Subject: RE: log4j problem


ok but the real problem is that struts logs an INFO each time a request is
processed. My webapp should handle hundreds of simultaneous clients
therefore my personal webapps logs are not visible enough. But thanks
anyway.


-Message d'origine-
De : Pani, Gourav [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:10
À : 'Struts Users Mailing List'
Objet : RE: log4j problem


You may want to increase your default console setting from DEBUG to WARN.
That would eliminate a lot of log messages.

-Original Message-
From: De Cesco, Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 5:09 AM
To: '[EMAIL PROTECTED]'
Subject: log4j problem


Hi all,
I was using Log4J with struts1.0 with no problem. When I updated to
struts1.1b3, messages from Struts like RequestProcessor Processing a POST
request for path url are logged using my webapp log4j configuration file.
The problem is I don't want struts to log these messages but it keeps using
my log4J configuration once it finds it.
anyone 

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

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

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



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

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

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



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

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




RE: log4j problem

2003-01-30 Thread De Cesco, Jonathan
With struts1.1b2 I think you need to get another commons-logging.jar first.
If it can help, Struts will use your log4j conf file if it finds it. In this
conf file you need to set specifically org.apache.struts to have a log level
as WARN for example (as shirishchandra sakhare said!).
In your webapp init servlet, you will have something like this:
PropertyConfigurator.configure(path_to_your_log4j_conf_file);

and the conf file could look like this:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=INFO, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{dd/MM/yy HH:mm:ss} %-5p %C{1}
%x - %m%n
log4j.logger.org.apache.struts=WARN

hope this helps.



-Message d'origine-
De : Matthew Meyer [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 30 janvier 2003 14:45
À : Struts Users Mailing List
Objet : Re: log4j problem


I am having a simmilar problem. I'm useing Struts 1.1b2 
within WTE 3.5. The digester and requestProcessor refuse 
to quit logging not matter what I set the log levels at. 
I'm guessing I'm just not finding the correct 
configuration file, but it's really getting annoying. 

Matt,

On Thu, 30 Jan 2003 11:09:10 +0100
  De Cesco, Jonathan [EMAIL PROTECTED] wrote:
Hi all,
I was using Log4J with struts1.0 with no problem. When I 
updated to
struts1.1b3, messages from Struts like RequestProcessor 
Processing a POST
request for path url are logged using my webapp log4j 
configuration file.
The problem is I don't want struts to log these messages 
but it keeps using
my log4J configuration once it finds it.
anyone 

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


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

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




Referring to pages in a different place

2003-01-22 Thread JONATHAN PHILIP HOLLOWAY
Ok, I've upgraded to tiles and have the following...

%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

tiles:insert page=../template.jsp flush=true
  tiles:put name=header value=../header.html /
  tiles:put name=mainmenu value=../mainmenu.html /
  tiles:put name=message value=../message.html / 
  tiles:put name=content value=assessmentcontent.jsp /
  tiles:put name=footer value=../footer.html /
/tiles:insert 

the only problem is that I get exception page not found for te files.  Is there
any way around this to get my pages to load from this directory:

http://localhost:8080/WebApp/

when I'm here:

http://localhost:8080/WebApp/assessment/

Can I use %=request.getContextPath()% or something like that within
my tiles file?

Many thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



A Useful Struts Resource

2003-01-22 Thread JONATHAN PHILIP HOLLOWAY
For those of you struggling with Struts at the moment, I know I am : ) there's a 
good resource at:

http://struts.application-servers.com/

A new version has just been released and it looks quite nifty, take a look at the
demo application on:

http://struts.application-servers.com/DemoServeurDeNews

A very useful example to show how complex client side user interfaces can be 
built up (using JSP and Javascript) and linked to Struts components.

The only I problem is I don't know how compatible this is gonna be with Netscape,
Mozilla and the other browsers.

Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: A Useful Struts Resource

2003-01-22 Thread JONATHAN PHILIP HOLLOWAY
Struts doesn't deal with client side browser stuff, your right,
but for those of us building complex user interface components
in a browser we have to use something.  Making the same
functionality available in desktop applications to web appliactions
is a big problem and we need a way of solving this.  HTML
doesn't do the job on its own and so we need a scripting language
like Javascript.  The point I was trying to make was if the Javascript
used is compatible with Netscape (and possibly Mozilla) as well as
IE which is what I was viewing it on.

Alternatively another method of complex client side user interfaces is
to use flash remoting and link it through to Struts

http://www.javaworld.com/javaworld/jw-01-2003/jw-0117-flash.html?

I think this has already been done but can't seem to find the link.

Jon.

- Original Message -
From: Rick Reumann [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]; JONATHAN
PHILIP HOLLOWAY [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 4:25 PM
Subject: Re: A Useful Struts Resource


 On Wednesday, January 22, 2003, 11:22:18 AM, JONATHAN wrote:

 JPH The only I problem is I don't know how compatible this is gonna be
with Netscape,
 JPH Mozilla and the other browsers.

 This isn't a struts issue. Struts doesn't even deal with client side
 browser stuff. Just do all your validation server side if you want and
 then you don't have to worry about the browser type.

 --

 Rick
 mailto:[EMAIL PROTECTED]




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




Action Servlet

2003-01-16 Thread JONATHAN PHILIP HOLLOWAY
Could somebody tell me if it's possible to get a handle on the action servlet 
from an action class and if so how this is actually done.

Many thanks in advance,
Jonathan Holloway.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Referring to resources elsewhere

2003-01-13 Thread JONATHAN PHILIP HOLLOWAY
I've currently got a problem with my template and it doesn't actually display
the pages that are referrred to in the parent folder.  I have the template 
defined as follows butI can't seem to reference mainmenu.html, 
message.html, submenu.html or footer.html in the following way.  Could 
somebody tell me exactly how it is defined.

My template resides in a folder called assessments whilst the other 
files reside in the folder above this.

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %

template:insert template='../template.jsp'

template:put name='header' content='header.html'/

template:put name='mainmenu' content='../mainmenu.html'/
template:put name='message' content='../message.html'/
template:put name='submenu' content='../submenu.html'/

template:put name='content' content='/AssessmentMenuContent.jsp'/

template:put name='footer' content='../footer.html'/

/template:insert

Many thanks in advance,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



nested tiles, I think

2003-01-13 Thread Jonathan Hodges
Hello,

I have a tile definition as follows:

definition name=pageConstructTile path=/jsp/templates/hscf.jsp
  put name=title value= /
  put name=header value=/jsp/pageConstruct/header.jsp/
  put name=sidebar value=/jsp/pageConstruct/sidebar.jsp/
  put name=footer value=/jsp/pageConstruct/footer.jsp/
  put name=content value=/jsp/pageConstruct/content.jsp/
/definition

I want the sidebar to reference a list of items to build the menu.  I accomplished it 
by adding a menu definition and menu.jsp as follows:

definition name=menu path=/jsp/pageConstruct/menu.jsp
  putList name=items
item value=Page One
  link=pageOneLink.do
  classtype=org.apache.struts.tiles.beans.SimpleMenuItem /
item value=Page Two
  link=pageTwoLink.do
  classtype=org.apache.struts.tiles.beans.SimpleMenuItem /
item value=Page Three
  link=pageThreeLink.do
  classtype=org.apache.struts.tiles.beans.SimpleMenuItem /
  /putList
/definition

%@ include file=/jsp/global/init.jsp %

table width='100%'
  tr
tdnbsp;/td
  /tr
  
  %-- Push tiles attributes in page context --%
  tiles:importAttribute /
  
  logic:iterate id=item name=items type=org.apache.struts.tiles.beans.MenuItem 
 
tr
  td align=centera href=%=item.getLink()% 
class=menuApplications%=item.getValue()%/td
/tr
tr
  tdnbsp;/td
/tr
tr
  tdnbsp;/td
/tr
  /logic:iterate

/table

I then reference the menu definition in sidebar.jsp like this:

%@ include file=/jsp/global/init.jsp %

tiles:insert definition=menu flush=true/

I was wondering if there would be a way to reference the menu tile definition directly 
in sidebar.jsp without having to create the menu.jsp.  I hope my question is clear.  I 
have heard people speak of nested tile definitions, but I have been unable to find an 
example.

Any help with this would be greatly appreciated,

Jonathan



Location of jsp files

2003-01-11 Thread Jonathan Hodges
Hello,
 
I was wondering what the best practice is for the location of my jsp
files in my web application.  I was thinking about placing them in the
WEB-INF directory so they couldn't be reached without going through the
ActionServlet.  I guess I could accomplish the same thing with the right
mapping the in the web.xml file as well.
 
Any suggestions?
 
Thanks in advance,
 
Jonathan Hodges
Infinity Insurance



Session Management

2003-01-10 Thread JONATHAN PHILIP HOLLOWAY
Hi everyone,

I'm wondering about the ways of managing sessions in Struts and wanted
to know out of these two ways which was the better way of doing things:

1. Storing things within the standard servlet session

2. Using a UserWrapper object and storing that within the session.

Is the second way more preformance intensive or not and which is best
practice?

Many thanks,
Jon Holloway.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Paper

2003-01-09 Thread Jonathan
Hi everyone,
 
I'm currently writing a paper for one of my University assignments on
web application frameworks.  It basically covers the different
approaches that web frameworks take and is focused around Struts and a
product currently being developed in the university using Struts.  It
also covers Maverick, Cocoon, Freemarker, Barracuda and Tapestry with an
overview of Java Server Faces.  The problem I have is that its very
difficult to get feedback on this type of thing with there being nobody
who really knows about these types of things.  If anybody could possibly
spare some time to have a wander through it and give me some feedback
then I would be very grateful as you guys are the experts here and
active users of the struts framework itself.  I've included it here as a
zipped attachment and if you could possibly spare some time to give me
some help and feedback on it then It'd be extremely appreciative,
 
Many thanks,
Jonathan Holloway.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



Paper

2003-01-09 Thread Jonathan
Ok,
 
Sorry to everyone about he last mail, it seems as if the server bounced
my attachment.
I've included links to it here.   (Original message enclosed also)
 
The document can be found here..
 
http://users.aber.ac.uk/jph8/frameworks.doc
 
Or in a zipped format here.
 
http://users.aber.ac.uk/jph8/frameworks.zip
 
Many thanks again for any feedback you can provide me with : )
 
Jonathan Holloway.
 
---
 
Hi everyone,
 
I'm currently writing a paper for one of my University assignments on
web application frameworks.  It basically covers the different
approaches that web frameworks take and is focused around Struts and a
product currently being developed in the university using Struts.  It
also covers Maverick, Cocoon, Freemarker, Barracuda and Tapestry with an
overview of Java Server Faces.  The problem I have is that its very
difficult to get feedback on this type of thing with there being nobody
who really knows about these types of things.  If anybody could possibly
spare some time to have a wander through it and give me some feedback
then I would be very grateful as you guys are the experts here and
active users of the struts framework itself.  I've included it here as a
zipped attachment and if you could possibly spare some time to give me
some help and feedback on it then It'd be extremely appreciative,
 
Many thanks,
Jonathan Holloway.
 
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



Re: Paper

2003-01-09 Thread JONATHAN PHILIP HOLLOWAY
Ok for the heathens amongst you its also here as a pdf.
I didn't want to convert it quite yet : )

http://users.aber.ac.uk/jph8/frameworks.pdf

Jon.

- Original Message -
From: Lenharcik, Juraj [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 3:20 PM
Subject: AW: Paper


.doc? bad ;-)

-Ursprüngliche Nachricht-
Von: Jonathan [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 9. Januar 2003 16:19
An: Struts-User@Jakarta. Apache. Org
Betreff: Paper


Ok,

Sorry to everyone about he last mail, it seems as if the server bounced
my attachment.
I've included links to it here.   (Original message enclosed also)

The document can be found here..

http://users.aber.ac.uk/jph8/frameworks.doc

Or in a zipped format here.

http://users.aber.ac.uk/jph8/frameworks.zip

Many thanks again for any feedback you can provide me with : )

Jonathan Holloway.

---

Hi everyone,

I'm currently writing a paper for one of my University assignments on
web application frameworks.  It basically covers the different
approaches that web frameworks take and is focused around Struts and a
product currently being developed in the university using Struts.  It
also covers Maverick, Cocoon, Freemarker, Barracuda and Tapestry with an
overview of Java Server Faces.  The problem I have is that its very
difficult to get feedback on this type of thing with there being nobody
who really knows about these types of things.  If anybody could possibly
spare some time to have a wander through it and give me some feedback
then I would be very grateful as you guys are the experts here and
active users of the struts framework itself.  I've included it here as a
zipped attachment and if you could possibly spare some time to give me
some help and feedback on it then It'd be extremely appreciative,

Many thanks,
Jonathan Holloway.


*-*
 Jonathan Holloway,
 Dept. Of Computer Science,
 Aberystwyth University,
 Ceredigion,
 West Wales,
 SY23 3DV.

 07968 902140
 http://users.aber.ac.uk/jph8
*-*


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




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




Web Application Frameworks Paper Overview

2003-01-09 Thread Jonathan
Hi everyone,
 
Just in case anybody missed this the first time as it was not posted as
a main topic I've just resent it with the links.. 
 
Original Message.
 
I'm currently writing a paper for one of my University assignments on
web application frameworks.  It basically covers the different
approaches that web frameworks take and is focused around Struts and a
product currently being developed in the university using Struts.  It
also covers Maverick, Cocoon, Freemarker, Barracuda and Tapestry with an
overview of Java Server Faces.  The problem I have is that its very
difficult to get feedback on this type of thing with there being nobody
who really knows about these types of things.  If anybody could possibly
spare some time to have a wander through it and give me some feedback
then I would be very grateful as you guys are the experts here and
active users of the struts framework itself.  If you could possibly 
spare some time to give me some help and feedback on it then I'd
be extremely appreciative,
 
Many thanks,
Jonathan Holloway.
 
PDF Document
http://users.aber.ac.uk/jph8/frameworks.pdf
 
Word Document
http://users.aber.ac.uk/jph8/frameworks.doc
 
Zipped
http://users.aber.ac.uk/jph8/frameworks.zip
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: monkey tree problem

2002-12-19 Thread JONATHAN PHILIP HOLLOWAY
I'm using Monkey Tree but I can't seem to get it to work under Struts 1.1,
which version are you using it under at present?  If it's 1.1 could you give
me a few pointers on how you got it working or mail me the war file if
that's not being too cheeky : )

Jon.

- Original Message -
From: Amit Badheka [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 12:48 PM
Subject: monkey tree problem


Hi All,

I have a requirement to generate the tree structure from the collection
object.

right now I am using the monkey tree to generate the tree structure for the
same.

The tree is generating fine. But, the problem is that I want to catch the
click event i.e. which node is clicked so that I can get the node name that
is clicked.

Is anybody is using monkey tree?

please help me to resolve this problem, also if there is any alternate
option let me know.

thanks a lot,

Amit Badheka.




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




JNDIConnectorPlugin Example - C.Caveness Book

2002-12-19 Thread JONATHAN PHILIP HOLLOWAY
Has anybody attempted to use the example in the Programming Jakarta Struts book
for the JNDI stuff.  It defines two things:

a) A JNDIConnectorPlugin class that takes the properties from the struts-config.xml
configuration file.

b) An EJBHomeFactory that uses the JNDIConnectorPlugin to lookup a reference to
an Enterprise Java Bean.

The JNDIConnectorPlugin simply takes the values from the config file and inserts 
them into the servlet context for retreval by any servlet via:

getServlet.getServletContext()

The problem with this is that it needs to call this from the EJBhomeFactory which
is simply a singleton class and has no reference to the Servlet Context.  In the book
by C.Caveness he retrieves these properties from a properties file but what I want
to do is to get them from the servlet context (which JNDIPlugin has used to place
the values).  Is there any way of doing this from a standard class or does 
EJBHomeFactory
need to be implemented as a servlet?  

Is this the best approach to take when looking up EJB's form an action class via
the jndi properties?  It seems to me like it is and I don't want to hardcode the values
in the EJBHomeFactory rather take them from the servlet context. 

Also when it comes to the EJBHomeFactory I only want to cache references to one EJB
namely my central facade session bean.  Does anybody know whether it's possible to
resuse the same instance (that's cached) in different action classes or does it have 
to be
a seperate instance for each action class (in a similar way to which a database 
connection
pool works).

Does anybody have any other better methods of looking up EJB's form action classes?

Many thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Internationlization Bug

2002-12-18 Thread JONATHAN PHILIP HOLLOWAY
Could somebody please tell me whether I can use the following:

message-resources parameter=applicationresources.properties/

to define my applicationresources.properties file (internationlisation file) under
Struts 1.1 or if I have to use the Struts 1.0 and web.xml way of specifying
the file:

init-param
  param-nameapplication/param-name
  param-valueApplicationResources.properties/param-value
/init-param

Many Thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Monkey Struts

2002-12-12 Thread Jonathan Holloway
Has anybody got Monkey Struts or the Monkey Tree example to work under
Struts 1.1b2
I can't seem to get it to work.  Are there any other complicated nesting
examples available?
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



RE: Struts you received a greeting card created by Gopal.

2002-12-05 Thread Jonathan Holloway
Don't open this message btw, I'm pretty sure it's a virus
and it sends to everyone in your address book if your using 
Outlook... from past experience of the thing :) thanks whoever
it is...

Jon Holloway.

-Original Message-
From: Gopal Patwa [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2002 19:17
To: Struts Users Mailing List
Subject: Struts you received a greeting card created by Gopal.

 

Struts,

Gopal sent you an ecard greeting.

Pick up your greeting card by using this URL.

http://www.FriendGreeting.com/pickup.aspx?code=Strutsid=0512023
http://65.240.226.242/203746/pickup.html?code=Strutsid=0512023 

Message:
Struts,
View the postcard recently emailed.
Gopal


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




HTML to JSP Conversion

2002-12-01 Thread Jonathan Holloway
Does anybody know of any tools that take a standard HTML page and
convert it straight
to JSP making use of the Struts tags in the process?
 
Jon Holloway.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



RE: HTML to JSP Conversion

2002-12-01 Thread Jonathan Holloway
Is there anything that's free, Scioworks Camino is a little bit out
of my budget.

Jon.

-Original Message-
From: Sarath Chandra M [mailto:[EMAIL PROTECTED]] 
Sent: 01 December 2002 16:35
To: 'Struts Users Mailing List'
Subject: RE: HTML to JSP Conversion

Try scioworks - camino 2.x.x

-Original Message-
From: Jonathan Holloway [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, December 01, 2002 8:31 PM
To: [EMAIL PROTECTED]
Subject: HTML to JSP Conversion


Does anybody know of any tools that take a standard HTML page and
convert it straight to JSP making use of the Struts tags in the process?
 
Jon Holloway.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


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



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




Obtaining the ActionServlet context from a utility class

2002-12-01 Thread Jonathan Holloway
Does anybody know how to get hold of the action servlet from a utility
class
so to get an attribute from the servlet context?  I'm basically trying
to do
this from a utility class but don't know how to go about it.
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



RE: Obtaining the ActionServlet context from a utility class

2002-12-01 Thread Jonathan Holloway
I'm embedding the attributes themselves in the struts-config file and
passing these to a custom struts plugin that I've created.  I then
embed these attributes in the servlet context on startup of the class
(i.e. in the init method).  

The thing is I have another factory class that needs access to the
servlet
context and that's the problem I have, getting hold of the action
servlet
before obtaining the servlet context to retrieve the attributes.

I sit possible just to embed the functionality of my factory class in my
plugin class and simply call the methods in the plugin class.  I didn't
think this was the right way hence the creation of a factory class and
a plugin class to do the job.

I don't want to use the utility in non Struts related classes either,
this is purely for my Struts action classes use.

Jon.

-Original Message-
From: Brian DeLuca [mailto:[EMAIL PROTECTED]] 
Sent: 01 December 2002 23:56
To: [EMAIL PROTECTED]
Subject: RE: Obtaining the ActionServlet context from a utility class

 



To use it in a utility class would mean you have to import the http
packages into your utility class -- not a good practice since other
projects, that are not web oriented may want to use them.

Why not just pass the attribute as a parameter to the method?



 --- On Sun 12/01, Jonathan Holloway  [EMAIL PROTECTED]  wrote:From:
Jonathan Holloway [mailto: [EMAIL PROTECTED]]To:
[EMAIL PROTECTED]: Sun, 1 Dec 2002 19:47:20
-Subject: Obtaining the ActionServlet context from a utility
classDoes anybody know how to get hold of the action servlet from a
utility
class
so to get an attribute from the servlet context?  I'm basically trying
to do
this from a utility class but don't know how to go about it.
 
Jon.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 


___
Can a Web portal forever change your life?
Win up to $25 Million on iWon - click here!


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




RE: Communication Between WebApps

2002-11-29 Thread Jonathan Holloway
This is exactly what I want to do with an authentication login
web application before passing the UserContainer object over
to whichever web application is appropriate based on their user
type.  If it's not possible to do this is it possible to do the 
following.

Given..

http://localhost/webappa

Can I send a Forward redirect to..

http://localhost/webappb

from within the first webapp or should it be done from a session
bean instead?

Jon.

-Original Message-
From: Ken Fitzpatrick [mailto:[EMAIL PROTECTED]] 
Sent: 29 November 2002 04:13
To: [EMAIL PROTECTED]
Subject: Re: Communication Between WebApps

I'm hearing more and more about real-world requirements for sharing 
information between WebApps -- not just the authentication thing, but 
entire business object graphs.

Consider the user's choice for the web site Skin.  Wouldn't it make 
sense for subsequently visited WebApps to honor the choice made in a 
previously executed WebApp?  What about an extensive UserProfile object 
graph, populated after the authentication process, from which a vast 
amount of personalization and customization content originates?

I work for a **really** large J2EE shop with many WebApps and we are in 
the endless pursuit of the one company image.  There seems to be no 
way to meet that requirement while also adhering to Servlet requirement 
of not sharing objects between WebApp sessions (I know, I know ... it's 
right there on page 51 of the J2EE Servlet Spec PDF.)

EJBs might go a long way to helping this, but precious few of the 
WebApps actually use them ... somebody said something about something 
that some else said about something they read from someone who sat next 
to someone who heard about someone who tried something sometime ago, 
somehow, somewhere, someway ... And now it's policy.  Besides, what if 
all that needs to be shared is the Struts SkinChooserFormBean?  Is that 
the ideal candidate for an Entity Bean?

So, is this the cross-roads of the real-world and the J2EE Servlet Spec?

Maybe we should think about some methodical means of being able to share

a given object or object graph across WebApps in a non-strategic, almost

casual context.  Something like contacting a broker, asking it to 
contact the WebApp that is registered as primary for a given type of 
object (e.g., UserProfile, SkinChooserFormBean, etc.) and having it 
extract and deliver a ReadOnly copy of the object?  Do I hear Betwixt 
buffering us from object version issues?

Any thoughts?

Thanks!
Ken



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



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




RE: Complicated Web Interfaces?

2002-11-28 Thread Jonathan Holloway
Ok fair enough but surely the issue of embedding all this javascript 
In my html is reversing the whole embedding presentation logic within
business logic?  Surely  embedding javascript in a JSP is just as bad 
as embedding scriptlets in a JSP?  Or am I missing the point here 
somewhere :) ?

Jonathan Holloway.

-Original Message-
From: Affan Qureshi [mailto:[EMAIL PROTECTED]] 
Sent: 28 November 2002 03:31
To: Struts Users Mailing List
Subject: Re: Complicated Web Interfaces?

My comment between lines.

 Say I want to display two lists of objects and swap lists in and out
of
 these two
 lists as required.

 List A   --   List B
 Object A  Object C
 Object B

 e.g. Move object B to List B

 I also want to add/remove objects as required to these lists.  Is this
 possible in
 Struts.  I've looked at the struts-layout library on
 http://struts-application-servers.com/
 but it look sto be buggy.  Has anbody actually had any success with
 this?

This is shown in Tiles portal example. Works pretty well for simple
purposes. Look at the place where you can add, delete, change tiles in
the
portal setup. You dont have to use tables like struts-layout. You can
use
some HTML select lists and some simple JS to manipulate them.

 I also want to be able to display a tree component to a user and allow
 the user to
 manipulate the tree by adding or removing nodes to the tree.  Is this
 possible with
 any of the struts user interface components or will I have to use an
 applet or a
 sophiticated javascript tree to achieve this.  If so how do I
integrate
 it with Struts?

Struts is just another Web application and runs servlets and JSPs. You
need
to come up with your own way to intergrate your stuff (JavaScript,
Applets)
with it. Struts does not provide you with an IDE. It provides you with a
framwork to make your work easy.

 I've also looked at the monkey-struts example as well but that seems
to
 lack the
 creation of objects in these lists, which doesn't look to be a problem
 to implement
 but that might be an oversight on my part : ) please let me know if
I'm
 wrong.


KB-Monkey-example uses a fixed object model (i.e it knows what fields
are
there in each object). However I think if you want the tree to be
dynamic
you can use the same technique with your own object model (which seems
to be
dynamic in content). The key to adding and deleting the nodes is the way
the
button clicks of Add and Delete are handled in a nested environment.
Nested tags enable you to remember the context of added and deleted
objects/nodes. You can use Map-backed properties for dynamic
form-fields.

But one issue with the monkey example is that it refreshes the page if I
want to add/delete an object/node. Wouldn't it be more efficient to use
JavaScript for the purpose? I mean why resend the request back to the
server
if you only want to add blank fields? If anybody has accomplished this
I
would be glad to know.

 I know there's a lot of questions abou the above and I'm still
pondering
 them as well
 myself but I just wanted to know whether it is possible to do this in
 Struts at present.
 From what I can see it is possible to create simple web based
 applications using
 Struts but I haven't come across any really complicated web interfaces
 yet using
 Struts, has anybody got any ideas on this or any examples of web
 applications that
 are a little more compicated.

 Many thanks,
 Jon Holloway.


If you find any such resource please let us know.

Regards,

Affan


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



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




RE: Complicated Web Interfaces?

2002-11-28 Thread Jonathan Holloway
I guess it's also easy to swap objects between the two models as well, 
this would be a nice addition to the example to allow bananas to be
swapped between bunches.  I did notice the new banana before but I
wanted 
it to take values from fields on the form but I guess this is very
simple 
to do now.  It solves my problem in theory at least : ) all I have to
work
out now is how to maintain a tree in Struts :( I don't think the applet
way
is a very nice way of doing it.

Jon.

-Original Message-
From: Arron Bates [mailto:[EMAIL PROTECTED]] 
Sent: 28 November 2002 13:06
To: Struts Users Mailing List
Subject: Re: Complicated Web Interfaces?

  I've also looked at the monkey-struts example as well but that seems
to
  lack the
  creation of objects in these lists, which doesn't look to be a
problem
  to implement
  but that might be an oversight on my part : ) please let me know if
I'm
  wrong.

Have another play, click on new banana... :)

http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp


 KB-Monkey-example uses a fixed object model (i.e it knows what fields
are
 there in each object). However I think if you want the tree to be
dynamic
 you can use the same technique with your own object model (which seems
to be
 dynamic in content). The key to adding and deleting the nodes is the
way the
 button clicks of Add and Delete are handled in a nested
environment.
 Nested tags enable you to remember the context of added and deleted
 objects/nodes. You can use Map-backed properties for dynamic
form-fields.
 
 But one issue with the monkey example is that it refreshes the page if
I
 want to add/delete an object/node. Wouldn't it be more efficient to
use
 JavaScript for the purpose? I mean why resend the request back to the
server
 if you only want to add blank fields? If anybody has accomplished
this I
 would be glad to know.

It's all up to watever you want to code. The fact that the monkey
example trips to the server has nothing to do with the nested tags.

To write the monkey example in Struts without the nested tags is verging
on impossible, at the very least a truly large headache, it was really
quite easy.

If the nested tags are guilty of anything, they make it very easy (and
even fun?... maybe I'm wired differently) to add more and more
complexity to the structure. The nested tags have made some truly
unwieldy applications, including the reason for their creation.

You just have to ask yourself one question...
Red or Blue pill?  :P


Arron.



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



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




RE: Complicated Web Interfaces?

2002-11-28 Thread Jonathan Holloway
Ok in principle then it seems fine it's just I don't like the fact 
that a scripting language whether client or server side can be 
embedded in the presentation logic, it still seems like a bit of
a workaround.  I've wondered about whether the Model2X approach and the
Model 2 approach for some while now and it seems like the latter doesn't
seperate the concerns as much as Model 2X.  The only thing that makes me
doubt this is the fact that Sun and yourself have gone this way via the 
Model 2 approach with Java Server Faces rather than the Model 2
approach. 
Is there any particular reason why this method is preferred over the
Model 2X approach?

Jon.

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
Sent: 28 November 2002 19:22
To: Struts Users Mailing List
Subject: RE: Complicated Web Interfaces?

(Waiting for the turkey to be ready ... :-)

On Thu, 28 Nov 2002, Jonathan Holloway wrote:

 Date: Thu, 28 Nov 2002 09:11:51 -
 From: Jonathan Holloway [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Complicated Web Interfaces?

 Ok fair enough but surely the issue of embedding all this javascript
 In my html is reversing the whole embedding presentation logic within
 business logic?  Surely  embedding javascript in a JSP is just as bad
 as embedding scriptlets in a JSP?  Or am I missing the point here
 somewhere :) ?


The big difference is that scriptlets execute on the server, as the page
is being generated -- and have access to the entire object model of your
application (leading to the temptation to embed business logic there).
JavaScript doesn't execute on the server, it executes on the client, and
doesn't have direct access to your business objects.

Embedding JavaScript to enhance the user experience (i.e. improve the
quality of the presentation) is fine.  An example of this is the client
side validation JavaScript that can be created by the Validator
Framework
-- this improves life for the user by catching errors earlier.

Using JavaScript to send background HTTP requests that grab stuff
directly
from the database (bypassing the normal control flow) and changing the
contents of select lists is a little more iffy -- but some intranet
based
apps (where the 100mbps network makes it pretty fast) will undoubtedly
use
such techniques to more accurately simulate what a GUI app can do.  You
can still flow such requests through the controller servlet, though --
to
special actions that just return data instead of HTML -- and that seems
fairly reasonable.

 Jonathan Holloway.


Craig


 -Original Message-
 From: Affan Qureshi [mailto:[EMAIL PROTECTED]]
 Sent: 28 November 2002 03:31
 To: Struts Users Mailing List
 Subject: Re: Complicated Web Interfaces?

 My comment between lines.

  Say I want to display two lists of objects and swap lists in and out
 of
  these two
  lists as required.
 
  List A   --   List B
  Object A  Object C
  Object B
 
  e.g. Move object B to List B
 
  I also want to add/remove objects as required to these lists.  Is
this
  possible in
  Struts.  I've looked at the struts-layout library on
  http://struts-application-servers.com/
  but it look sto be buggy.  Has anbody actually had any success with
  this?

 This is shown in Tiles portal example. Works pretty well for simple
 purposes. Look at the place where you can add, delete, change tiles in
 the
 portal setup. You dont have to use tables like struts-layout. You can
 use
 some HTML select lists and some simple JS to manipulate them.

  I also want to be able to display a tree component to a user and
allow
  the user to
  manipulate the tree by adding or removing nodes to the tree.  Is
this
  possible with
  any of the struts user interface components or will I have to use an
  applet or a
  sophiticated javascript tree to achieve this.  If so how do I
 integrate
  it with Struts?

 Struts is just another Web application and runs servlets and JSPs. You
 need
 to come up with your own way to intergrate your stuff (JavaScript,
 Applets)
 with it. Struts does not provide you with an IDE. It provides you with
a
 framwork to make your work easy.

  I've also looked at the monkey-struts example as well but that seems
 to
  lack the
  creation of objects in these lists, which doesn't look to be a
problem
  to implement
  but that might be an oversight on my part : ) please let me know if
 I'm
  wrong.
 

 KB-Monkey-example uses a fixed object model (i.e it knows what fields
 are
 there in each object). However I think if you want the tree to be
 dynamic
 you can use the same technique with your own object model (which seems
 to be
 dynamic in content). The key to adding and deleting the nodes is the
way
 the
 button clicks of Add and Delete are handled in a nested
environment.
 Nested tags enable you to remember the context of added and deleted
 objects/nodes. You can use Map-backed properties

Complicated Web Interfaces?

2002-11-27 Thread Jonathan Holloway
I'm still wondering about the use of Struts for more complicated web
applications.
In particular for things where we require nesting of objects and
manipulation of
these objects via web interface.  
 
Say I want to display two lists of objects and swap lists in and out of
these two
lists as required.
 
List A   --   List B
Object A  Object C
Object B
 
e.g. Move object B to List B
 
I also want to add/remove objects as required to these lists.  Is this
possible in
Struts.  I've looked at the struts-layout library on
http://struts-application-servers.com/
but it look sto be buggy.  Has anbody actually had any success with
this?
 
I also want to be able to display a tree component to a user and allow
the user to
manipulate the tree by adding or removing nodes to the tree.  Is this
possible with
any of the struts user interface components or will I have to use an
applet or a
sophiticated javascript tree to achieve this.  If so how do I integrate
it with Struts?
 
I've also looked at the monkey-struts example as well but that seems to
lack the 
creation of objects in these lists, which doesn't look to be a problem
to implement
but that might be an oversight on my part : ) please let me know if I'm
wrong.
 
I know there's a lot of questions abou the above and I'm still pondering
them as well 
myself but I just wanted to know whether it is possible to do this in
Struts at present.
From what I can see it is possible to create simple web based
applications using
Struts but I haven't come across any really complicated web interfaces
yet using
Struts, has anybody got any ideas on this or any examples of web
applications that
are a little more compicated.  
 
Many thanks,
Jon Holloway.
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



Communication Between WebApps

2002-11-26 Thread Jonathan Holloway
I'm trying to develop a Struts feasibility example for my project and
I've come across a small problem.  I really want to have three web
applications where the first web application is used for 
authentication and authorization.  Is it possible once I've authorized a
user to forward them to another web application?  Is it just a case of
setting up a mapping in the config file for the first web app and
forwarding to a specific mapping which will be recognised by tomcat as
the second app and therefore switch control?
 
Many thanks,
Jon Holloway.
 
 
*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*
 



RE: [ANNOUNCE] O'Reilly Struts Book Now Available

2002-11-24 Thread Jonathan Holloway
Just out of interest Chuck, are the examples that are mentioned in your
book in particular the online banking example and the virtual shopping
example available in any form.  I can't seem to see the examples to
download from the Oreilly website.

Thanks,
Jonathan Holloway.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 25 November 2002 00:54
To: [EMAIL PROTECTED]
Subject: [ANNOUNCE] O'Reilly Struts Book Now Available

I just wanted to let everyone know that my Struts book published by
O'Reilly is 
now available and shipping. You can get it from Amazon, Bookpool, etc. 

Again I wanted to say thanks to all of those who reviewed and provided
feedback on the material. It was a great aide for me to get that sort of
instant feedback, both positive and negative. As Craig and Ted have said
many times, the Struts mailing list is very unique and full of really
great people. I hope it adds value to the community.

Thanks to all,

Chuck Cavaness
Author - Programming Jakarta Struts
ISBN: 0596003285

Amazon
http://www.amazon.com/exec/obidos/ASIN/0596003285/qid=1038174812/sr=2-1/
ref=sr_2_1/104-4064794-3140717

Bookpool
http://www.bookpool.com/.x/6kq93k1kim/sm/0596003285

O'Reilly
http://www.oreilly.com/catalog/jakarta


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



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




RE: html:form frustration

2002-09-20 Thread Jonathan Kovacs

Hi Danny,

Checking the code for FormTag.getActionMappingName() it takes everything
from the last / in the name, strips off any paramters (?), then anything
after the last . (eg. .do)  So, to the form tag at least, /edit, /edit.do
and /edit.do?action=goInsane are all equivalent.

On the bright side, I did find my problem. It was a pretty newbie
error...which makes sense since I'm pretty newbie to struts. My mistake was
in trying to bypass the Controller...(Bad programmer! Never sidestep the
architecture...unless you REALLY mean it! ;)

The path I gave earlier:

/jsp/index.jsp -- /load.do -- /jsp/edit.jsp

What it SHOULD have been:

/jsp/index.jsp -- /load.do -- /edit.do -- /jsp/edit.jsp

This allows the controller to instantiate an editForm bean and store it in
the request scope. 

Thanks for all your help though! =)

Jonathan

-Original Message-
From: Danny Mui [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 19, 2002 5:46 PM
To: Struts Users Mailing List
Subject: Re: html:form frustration


Hi Jonathan,

Sorry I jumped to conclusions :).

I believe the action looker-upper ignores .do part in your action in the 
form tag but the correct syntax would be :

html:form action=/edit
/html:form

Since your action config specifies /edit your form tag should also 
specify /edit.

I think that is what is confusing the lookup.  It's looking for a 
mapping of /edit.do (that doesn't exist) where the action servlet 
disregards .do part and properly dispatches.

hth

danny


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




html:form frustration

2002-09-19 Thread Jonathan Kovacs
 bean definition
ActionFormBean formBean =
formBeans.findFormBean(mapping.getName());
if (formBean == null) {
JspException e = new JspException
(messages.getMessage(formTag.formBean,
mapping.getName()));
pageContext.setAttribute(Action.EXCEPTION_KEY, e,
 PageContext.REQUEST_SCOPE);
throw e;
}

// Calculate the required values
name = mapping.getName();   // --- Line 803
scope = mapping.getScope();
servlet = mappings.getServlet();
type = formBean.getType();

Any suggestions would be *greatly* appreciated!

Thanks,

Jonathan Kovacs




RE: html:form frustration

2002-09-19 Thread Jonathan Kovacs

Thanks for the clarification, Kevin.  I misunderstood what Danny was saying
in his code snippet.  After looking at it again, I noticed that he'd added
the name attribute to the action mapping for the /load action...

Unfortunately, that isn't my problem. /load.do doesn't display a form.  All
it does is load a list of values and stores them to the session context (so
they can be displayed in a select box by edit.jsp).  It then forwards to the
edit.jsp.  

It's the form on edit.jsp which is the problem. (if I take out the
html:form tag and replace it with an html:iterate which iterates through
my list, it works fine)  For some reason, it's having trouble with lookup on
the /edit.do action specified in the html:form tag. Looking at the /edit
action-mapping entry, it DOES have the name=editForm definition.

Jonathan

-Original Message-
From: Kevin A. Smith [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 19, 2002 3:37 PM
To: Struts Users Mailing List
Subject: RE: html:form frustration


That just associates a logical form name with the underlying Java
implementation. You still need to tell Struts which form bean the action
uses.

--Kevin

-Original Message-
From: Jonathan Kovacs [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 3:35 PM
To: Struts Users Mailing List
Subject: RE: html:form frustration


Danny,

Isn't that what this section of my struts_config.xml is for? 

  form-beans
form-bean name=editForm
   type=test.web.editForm /
  /form-beans

Jonathan


-Original Message-
From: Danny Mui [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 19, 2002 3:05 PM
To: Struts Users Mailing List
Subject: Re: html:form frustration


Looks like you're missing a form definition, lookup (the method causing 
the exception) is looking for the form bean when no name is specified in 
the field definition.

  action path=/load
type=test.web.LoadAction
-- name=editForm 
scope=request
validate=true
  forward name=continue
   path=/jsp/edit.jsp
  /forward
/action

Hope that works!

danny

Jonathan Kovacs wrote:

Hi All,

I've been beating my head against this problem for a couple days now
and frankly, I'm stumped...

Using Struts 1.0.2, I'm attempting to display a select box which is
filled with a list of options loaded into the session context.  I've 
verified that the options are loaded (using an html:iterate tag), but 
for some reason, the instant I add an html:form tag to my .jsp, all hell
breaks loose.

The path my application follows is this:

/jsp/index.jsp -- /load.do -- /jsp/edit.jsp

The relevant sections of my struts-config.xml file:

struts-config

  !-- == Form Bean Definitions
 ===
--
  form-beans
form-bean name=editForm
   type=test.web.editForm /
  /form-beans

  !-- == Action Mapping Definitions
 ==
--
  action-mappings
action path=/load
type=test.web.LoadAction
scope=request
validate=true
  forward name=continue
   path=/jsp/edit.jsp
  /forward
/action
action path=/edit
type=test.web.EditAction
name=editForm
scope=request
input=/jsp/edit.jsp
validate=false
  forward name=cancel
   path=/jsp/index.jsp
  /forward
  forward name=continue
   path=/jsp/edit.jsp
  /forward
/action
  /action-mappings
/struts-config

In edit.jsp:

html:form action=/edit.do
  html:select property=name
html:options collection=%= Constants.DATA % 
property=label/
  /html:select
/html:form

The error:

javax.servlet.ServletException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte
xtImp
l.java:471)
at org.apache.jsp.edit$jsp._jspService(groups$jsp.java:312)
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.j
a
va: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(ApplicationDispat
cher
.
java:683)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis
patc
h
er.java:431)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa
tche
r
.java:355)
at 
org.apache.struts.action.ActionServlet.processActionForward(ActionServl
et.j
a
va:2199)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:2023)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:540

Re: problem with HttpSession in Resin-2.1.2

2002-07-24 Thread Jonathan Fuerth

On Tue, Jul 23, 2002 at 06:06:08PM +0100, David Mulligan wrote:
 Everthing works just fine on Tomcat 4.0.3 and Websphere. 
 But for some strange reason the HttpSession I create in my LogonAction loses
 an attribute (The UserBean) in the next request (only with Resin)!

Are there any JSPs involved in your testing?  They always seem to
create a session when they start up.  If for some reason (short
timeout or otherwise) the initial session you created and put the user
bean into was invalid when a JSP started, it would create a new
(empty) session, which could be what you're seeing in that second
servlet.  The locale attribute probably comes from a html:html
locale=true tag in your JSP (assuming you are using a JSP).

Do try and set the session timeout in web.xml (as you mentioned).. a
very short session timeout is one possible explanation for what's
going on.

I don't know if this will help you solve the problem, but that's my
best guess at what's happening to your session.  Good luck with it!

-- 
Jonathan Fuerth - SQL Power Group Inc.
(416)218-5551 (Toronto); 1-866-SQL-POWR (Toll-Free)
Unleash the Power of your Corporate Data - http://www.sqlpower.ca/

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




Re: problem with HttpSession in Resin-2.1.2

2002-07-24 Thread Jonathan Fuerth

On Wed, Jul 24, 2002 at 04:08:33PM +0100, David Mulligan wrote:
 Now I'm really confused!!!

Oops, sorry. :)

 I'm using Velocity for the presentation, so no JSPs or tags. 
 I'm guessing the LOCALE attribute is coming from the web 
 browser! I also tried setting the session-timeout to 30 
 minutes in web.xml and that didn't work either.

No, the session is stored only on the server side.  The web browser
has no direct control over what's actually in the session.. it just
remembers a session key which helps the server figure out which
session object to use for the current request.  Your browser can make
the whole session seem to go away (by refusing to remember the session
key) but it can't add or remove items that are stored inside a
particular session.

 But this is where things get really strange! 
 
 I started up K-Meleon (Mozilla browser) to check and see if 
 MS-IE was sending my location in the request (Hence the 
 LOCALE attribute) and everything worked just fine! 
 
 Not one problem! I can login/logout etc. UserBean is getting 
 saved in the Session. Everything works as expected!
 
 Back to IE and it still doesn't work. IE is setup to check 
 for newer page version with each request. So it's not a 
 problem with the cache. 

Maybe we've both overlooked the obvious: Is it at all possible that
you've got cookies turned off in your MSIE privacy options?  That's
what it sounds like at this point.

-- 
Jonathan Fuerth - SQL Power Group Inc.
(416)218-5551 (Toronto); 1-866-SQL-POWR (Toll-Free)
Unleash the Power of your Corporate Data - http://www.sqlpower.ca/

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




problem with error messages

2002-07-09 Thread Jonathan Corbin

Hello,

I am getting the following error message on one of my
jsps:

javax.servlet.ServletException: Exception creating
bean of class com.valleyrec.toteboard.beans.Toteboard:
{1}

I know from browsing the struts source that the {1}
should be the forward.forward property from
org.apache.struts.taglib.logic.LocalProperties.properties.
 That message is:

Exception forwarding for name {0}: {1}

with the {0} and {1} replaced by parameters.  I've had
this problem across multiple versions of struts
(including today's cvs and a few daily builds from
last week).  Does anyone know why I'm not getting the
correct error messages?  Could this be a bug, or do I
have some sort of configuration error?

Jonboy Corbin

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




  1   2   3   4   >