Re: difficult problem, preventing population

2003-07-15 Thread Nagendra Kumar O V S








   
  hi,
  struts does support for transaction tokens , pl check the struts docs 
  for the api & implementation
   
  -- nagi
  ---Original Message---
   
  
  From: Struts Users Mailing 
  List
  Date: Wednesday, July 
  16, 2003 07:24:58 AM
  To: [EMAIL PROTECTED]
  Subject: difficult 
  problem, preventing population
   I have the following scenario occuring.I have a 
  form with several fields on it (the fields are sourced to a collection 
  in an ActionForm).I have a button that allows the removal of fields 
  from the form (items from the collection).If a user removes a 
  field from the form and then double submits/clicks back and reloads 
  then anexception is thrown from BeanUtils.populate() because it 
  attempts to take details from the (nowremoved field) and populate 
  it into the object that is stored in the position it was located in 
  thecollection. Obviously since the collection is now smaller this 
  results in anIndexOutOfBoundsException.Is there any way to 
  examine the transaction token from the form prior to the form bean 
  beingpopulated and then avoid population of the form bean if the token 
  is not valid?Help with this problem would be greatly 
  appreciated.Rob-To 
  unsubscribe, e-mail: [EMAIL PROTECTED]For 
  additional commands, e-mail: [EMAIL PROTECTED].





	
	
	
	
	
	
	




  IncrediMail - 
Email has finally evolved - Click 
Here



Character encoding of custom tag output

2003-07-15 Thread Rick Mann
We have a situation where we've created a custom  tag that
reads text from a file and writes it to the pageContext.getOut() JspWriter.

The problem is that the file is ISO-8859-1 (Latin 1) encoded. When it gets
brought into a String (via any method you care to suggest), it gets
converted to UTF-16 (Java's internal representation). When it subsequently
gets written out, it's a stream of UTF-16-encoded bytes that the browser
interprets as ISO-8859-1 latin text.

We cannot change the META tag to indicate that the text is UTF-16, because
the rest of the JSP is latin 1.

There does not appear to be a way to output raw bytes to the output stream,
nor does there appear to be a way to tell the JspWriter that it should be
printing Strings by encoding them into ISO-8859-1. (I really hope I'm wrong
on this last point).

Does anyone have any suggestions on how we can cope with this situation? I
find it hard to believe that it's a rare problem.

Thank you.

-- 
Rick


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



RE: Passing Parameters Between Actions

2003-07-15 Thread Andrew Hill

Is there any reason you are forwarding from JSP?


JSP where got?
He stated quite clearly he is forwarding from one action to another using
(returning I presume) an ActionForward.





I was going to suggest that you specify redirect="false" in the forward, but
looking at the javadoc it seems that that is the default already! Hmm.. Try
it anyway and see if it works as it sounds very much like your doing a
client side redirect :-)

If it really is doing a server side redirect you should still be able to get
at that parameter - the only situation I can think of where you would get
these symtoms is if its a multipart request and the first action has an
actionform associated with it and the second does not. (If if that parameter
is due to some other request wrapper implementation). That doesnt explain
the attributes not working though. It really does sound like your doing a
client side redirect.

Hmmm... just checked the source and its definately default to
redirect=false. Ok, I give in...

btw: its considered bad practice to chain actions in this manner. Search the
archive to find out why...

-Original Message-
From: Jung Yang [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 15 July 2003 22:31
To: [EMAIL PROTECTED]
Subject: Re: Passing Parameters Between Actions


Is there any reason you are forwarding from JSP?  Try using Dispatcher
in Action1 class like

request.getRequestDispatcher("/Action2.do").forward(request, response);

- jung

Hunter Hillegas wrote:
> I am trying to pass a parameter between two actions and running into
> trouble.
>
> I call action 1 like this: /Action1.do?rec_num=1
>
> Action1 does some processing and when complete it forwards via an
> ActionForward to Action2 as such:
>
> 
>
> Action2 has no way to retrieve the parameter originally passed in to the
> first action, "rec_num". When I try to grab it using
request.getParameter()
> I get a NPE.
>
> I also tried setting it as a request attribute and that didn't work.
Session
> might work but I am trying not use sessions.
>
> Any ideas on what I can do?
>
> Thanks,
> Hunter



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



[OT] Re: 4th Of July Struts Challenge...

2003-07-15 Thread Rick Reumann
Kris... this was just awesome! Thanks. You da 'man:)

On Tue, Jul 15,'03 (11:25 AM GMT-0400), Kris wrote: 

> As it turns out, some of my ideas about a "standard" property of type
> Map versus a "mapped property" were a bit off. So, if you're still
> interested, here's something I hacked together. You'll notice I used a
> session scoped form so that Struts doesn't choke when it tries to
> populate the form.
> 
> struts-config.xml:
> --
> 
> 
> type="org.apache.struts.action.DynaActionForm">
> 
> 
> 
> 
> 
>  type="com.dotech.EditEmployeesAction"
> name="employeesForm"
> scope="session"
> validate="false">
> 
> 
>  type="org.apache.struts.actions.ForwardAction"
> parameter="/viewEmployees.jsp"
> name="employeesForm"
> scope="session"
> validate="false"/>
> 
> 
> 
> editEmployees.jsp:
> --
> 
> <%@ taglib prefix="bean"
> uri="http://jakarta.apache.org/struts/tags-bean"; %><%@ taglib
> prefix="c"uri="http://java.sun.com/jstl/core"; %><%@ taglib
> prefix="html" uri="http://jakarta.apache.org/struts/tags-html"; %>
> 
> <%-- dynamically get a handle to the form --%>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   Edit Employees
> 
>   
> 
>   
> 
>   
> 
> 
> name="  value="employeesMap(${entry.key}).name"/>"
>  value="">
> 
> 
> name="  value="employeesMap(${entry.key}).age"/>"
>  value="">
> 
>   
> 
> 
>   
> 
>   
> 
>   
> 
> 
> 
> 
> EmployeeBean.java:
> --
> 
> package com.dotech;
> 
> public class EmployeeBean {
> 
> private String name;
> private String age;
> 
> public EmployeeBean(String name, String age) {
> this.name = name;
> this.age = age;
> }
> 
> public String getName() { return this.name; }
> public void setName(String name) { this.name = name; }
> 
> public String getAge() { return this.age; }
> public void setAge(String age) { this.age = age; }
> }
> 
> 
> EditEmployeesAction.java:
> -
> 
> package com.dotech;
> 
> import java.util.*;
> import javax.servlet.http.*;
> import org.apache.commons.beanutils.*;
> import org.apache.struts.action.*;
> 
> public class EditEmployeesAction extends Action {
> 
> public ActionForward execute(ActionMapping mapping,
>  ActionForm form,
>  HttpServletRequest request,
>  HttpServletResponse response) throws
>  Exception {
> Map empMap = new HashMap();
> empMap.put("", new EmployeeBean("John Doe", "33"));
> empMap.put("", new EmployeeBean("Loser Boy", "22"));
> PropertyUtils.setProperty(form, "employeesMap", empMap);
> return mapping.findForward("success");
> }
> }
> 
> 
> viewEmployees.jsp:
> --
> 
> <%@ taglib prefix="bean"
> uri="http://jakarta.apache.org/struts/tags-bean"; %><%@ taglib
> prefix="c"uri="http://java.sun.com/jstl/core"; %>
> 
> <%-- dynamically get a handle to the form --%>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> View Employees
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Quoting Kris Schneider <[EMAIL PROTECTED]>:
> 
> > Okay, so that's way too much work ;-). I'm not sure, but I think one
> > of the issues you're running into is the difference between a
> > "standard" property of
> > type Map and a "mapped property". The first is declared like:
> > 
> > public Map getEmployeesMap()
> > public void setEmployeesMap(Map m)
> > 
> > The second is declared like:
> > 
> > public Object getEmployeeMapped(String key)
> > public void setEmployeeMapped(String key, Object value)
> > 
> > For a mapped property, you'd use a reference like
> > "employeeMapped()" to get
> > the object stored under the "" key. I really haven't played much
> > with either
> > of the above cases, so I may be off base...
> > 
> > Quoting Rick Reumann <[EMAIL PROTECTED]>:
> > 
> > > Ok stupid subject line, but now I can get back to something I was
> > > curious about that I posted around a week ago. I'm really curious
> > > how to do accomplish this and yes have tried it a bunch of
> > > different ways... 
> > > 
> > > Here's the challenge
> > > 
> > > First challenge is just with a regular ActionForm...
> > > 
> > > 

RE: checkboxes - ActionForm in session scope

2003-07-15 Thread Andrew Hill

I call reset method selectively since I am trying to develope wizard style
pages with one form.


Ah, but if you dont reset the checkbox it will always stay ticked - as
nothing (not even an empty string!) is submitted for an unticked checkbox so
the forms setter method is never called.

THIS is the real reason the reset() method even exists in the first place -
its a workaround for this flaw in the html spec. Other fields that need to
be reset include multiple-select boxes and textareas. Empty input fields
will submit an empty string so they dont need to be reset, and single
selects always have something selected so dont need it either.

If your doing wizards you should still call reset() but you do the selective
stuff inside the code for the reset() method (such that it resets only those
fields that were visible on the page just submitted).

-Original Message-
From: Khalid K. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 16 July 2003 01:54
To: Struts Users Mailing List
Subject: checkboxes - ActionForm in session scope


Hello All,

I have the following problem, and any help is greatly appreciated:

1. html form that has a checkbox which is associated with a Action Form
Bean - boolean attribute
2. ActionForm is in session scope
3. I call reset method selectively since I am trying to develope wizard
style pages with one form.
4. using struts 1.0.2

problem:

  When I check a checkbox and submit the form, on the "pending" page, I see
the value as set to "true" which is OK.

Now, When I click on "modify" which takes me to the html with the form, and
I uncheck the checkbox and submit againthe value on the "pending" page
is still set to TRUE. Which it should be set to FALSE.  any ideas ??

Khalid
- Original Message -
From: "John M. Corro" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 10:48 AM
Subject: Re: Is this really the best way to handle this problem


> I've seen two ways of dealing w/ this problem, both of which I see as
'hackish'
> in nature.
>
> Solution A:
>
> In your getters/setters you implement the following code
>
> public MyCustomBean getMyCustomBean(int index) {
>while(index >= myCustomBeanList.size()) {
>   myCustomBeanList.add(new MyCustomBean());
>}
>return (MyCustomBean)myCustomBeanList.get(index);
> }
>
> In that way you'll never encounter the common IndexOutOfBoundsException.
The
> problem here is that you tend to use alot of hidden fields in your UI to
repopulate
> the data back into the dynamically created beans.
>
> Solution B:
>
> In your reset() method you repopulate your internal Collection of beans.
The
> problem w/ this approach is that often times you have a separate Action
that
> prepopulates your ActionForm.  This provides for good separation - the
Action
> is a retriever of a data (nothing more) and the ActionForm is merely a
container
> for data (nothing more).  With this approach your ActionForm suddenly
starts
> becoming more intelligent than it really should be.  Now it's aware of how
to
> populate itself...not a good thing IMO.
>
> I'd be very interested in hearing other solutions to this problem as I
find
> both of the above solutions cumbersome and hackish and would love to stop
implementing
> them.
>
> >I've been struggling with a problem similar to the one described (and
> >solved) at
> >http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html
.
>
> >Is this really the recommended way to solve population / repopulation of
> >properties stored in a List() of
> >whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way
to
>
> >acheive the same result ? (I.e represent a collection in a form)
> >
> >I've read that a practice often used to represent collections (a DB-table
> >for intstance) is to make a bean that has getters / setters for the
> >properties of a single row and then have the ActionForm contain a List()
of
>
> >those beans. One for every row  (in the DB-example). That far I can
follow,
>
> >and see how / why. But is there no better way to update the values in the
> >ActionForm (beans) when the data is submitted than in the URL above ?
> >
> >//Linus Nikander - [EMAIL PROTECTED]
> >
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> John M. Corro
> Cornerstone Consulting
>
> -
> 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: which way..struts using tiles?

2003-07-15 Thread Tin Pham
I am using struts with tiles and it works great.


"Butt, Dudley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Just need some info on what you guys are using out there, and what
strategy is working the best for you.
> Lets say i want to use Struts and I need to get a nice webapp out there.
The system is potentially large so I'm going to need some sort of
> build/generation tools. What are you guys using for your presentation look
and feel. How are you getting your pages generated? Any ideas will be
> greatly appreciated!!
> Many thx
>
>
> NOTICE:
>
> This message contains privileged and confidential information intended
> only for the person or entity to which it is addressed.
> Any review, retransmission, dissemination, copy or other use of, or
> taking of any action in reliance upon this information by persons or
> entities other than the intended recipient, is prohibited.
>
> If you received this message in error, please notify the sender
> immediately by e-mail, facsimile or telephone and thereafter delete the
> material from any computer.
>
> The New Africa Capital Group, its subsidiaries or associates do not
> accept liability for any personal views expressed in this message.




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



difficult problem, preventing population

2003-07-15 Thread Rob
I have the following scenario occuring.

I have a form with several fields on it (the fields are sourced to a 
collection in an ActionForm).
I have a button that allows the removal of fields from the form (items 
from the collection).
If a user removes a field from the form and then double submits/clicks 
back and reloads then an
exception is thrown from BeanUtils.populate() because it attempts to 
take details from the (now
removed field) and populate it into the object that is stored in the 
position it was located in the
collection.  Obviously since the collection is now smaller this results 
in an
IndexOutOfBoundsException.

Is there any way to examine the transaction token from the form prior to 
the form bean being
populated and then avoid population of the form bean if the token is not 
valid?

Help with this problem would be greatly appreciated.

Rob

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


Re: How do I implement a Master/Detail maintenance form?

2003-07-15 Thread Jing Zhou

- Original Message - 
From: "Shane Mingins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 4:58 PM
Subject: How do I implement a Master/Detail maintenance form?


> Hi
>
> Are there any *best practices* or examples around showing the best way of
> implementing the maintenance of a master/detail relationship using the
> Struts framework?
>
> For example if I provide a form with a supplier and list of products where
> you can edit the supplier details and/or edit the product details, to
select
> the product to edit I need to provide a key to identify that product.  I
can
> use a link but then any changes to the supplier are not kept as the link
> does not submit the form.

I presume your supplier page is the master page and it contains a list of
links pointing to a product page. If this is the case, I use Java scripts to
force a submission in order to sync the supplier's data with the form bean
before forwarding to the product page.

>
> Thanks
> Shane
>
>
> Shane Mingins
> Analyst Programmer
> Assure NZ Ltd
> Ph 644 494 2522
>

Jing
Netspread Carrier
http://www.netspread.com

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


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



Re: Where to build dropdown lists?

2003-07-15 Thread Rick Reumann
On Tue, Jul 15,'03 (04:04 PM GMT+0200), Adam wrote: 
  
> Since it's in my action base class, I never have to worry about 
> programming it manually.

If you are always going to check that the List is there in your
BaseAction class, why not just give the List application scope on start
up and not have to worry about checking for it?



-- 
Rick

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



Re: PropertyMessageResourcesFactory ClassNotFoundException

2003-07-15 Thread Craig R. McClanahan


On Tue, 15 Jul 2003, Jim Ryan wrote:

> Date: Tue, 15 Jul 2003 17:25:31 -0700
> From: Jim Ryan <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: PropertyMessageResourcesFactory ClassNotFoundException
>
> I have a fresh installation of the following on Windows XP:
>
>
>
> - Java 1.3.1_08 SDK
>
> - Tomcat 3.2.3

Tomcat 3.2 has fatal flaws in its class loader, and is not a supported
platform for Struts 1.1.  For Servlet 2.2/JSP 1.1, your better choice is
Tomcat 3.3; for support of the most current production standards (Servlet
2.3 and JSP 1.2) your best choice is Tomcat 4.1.  The latter choice will
also give you substantially better performance on JSP pages with lots of
custom tags (which is typical for Struts based applications that use JSP).

>
> - Struts 1.1
>

Craig McClanahan

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



PropertyMessageResourcesFactory ClassNotFoundException

2003-07-15 Thread Jim Ryan
I have a fresh installation of the following on Windows XP:

 

- Java 1.3.1_08 SDK

- Tomcat 3.2.3

- Struts 1.1

 

If I run Tomcat it starts fine, and all the examples work.

 

However, if I drop the Struts 1.1 "struts-blank.war" or "struts-example.war"
into the tomcat/webapps dir, I get the following exception when starting
Tomcat:

 

2003-07-15 16:44:40 - ContextManager: Adding context Ctx( /examples )
2003-07-15 16:44:40 - ContextManager: Adding context Ctx( /admin ) Starting
tomcat. Check logs/tomcat.log for error messages 2003-07-15 16:44:40 -
ContextManager: Adding context Ctx(  ) 2003-07-15 16:44:40 - ContextManager:
Adding context Ctx( /struts-example ) 2003-07-15 16:44:40 - ContextManager:
Adding context Ctx( /test ) [ERROR] MessageResourcesFactory -
-MessageResourcesFactory.createFactory java.lang.ClassNotFoundException: 

ry>org.apache.struts.util.PropertyMessageReso

rcesFactory

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.ja

a:207)

at
org.apache.struts.util.MessageResourcesFactory.createFactory(Message

esourcesFactory.java:192)

at
org.apache.struts.util.MessageResources.getMessageResources(MessageR

sources.java:576)

at
org.apache.struts.util.RequestUtils.(RequestUtils.java:134)

at
org.apache.struts.util.MessageResourcesFactory.createFactory(Message

esourcesFactory.java:192)

at
org.apache.struts.util.MessageResources.getMessageResources(MessageR

sources.java:576)

at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.ja

a:1329)

at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)

at javax.servlet.GenericServlet.init(GenericServlet.java:258)

at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317

 

at org.apache.tomcat.core.Handler.init(Handler.java:215)

at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)

at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadO

StartupInterceptor.java:130)

at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.jav

:491)

at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)

at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)

at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)

 

[ERROR] MessageResourcesFactory - -MessageResourcesFactory.createFactory
java.lang.ExceptionInInitializerError:
java.lan .NullPointerException

at
org.apache.struts.util.MessageResources.getMessageResources(MessageR

sources.java:577)

at
org.apache.struts.util.RequestUtils.(RequestUtils.java:134)

at
org.apache.struts.util.MessageResourcesFactory.createFactory(Message

esourcesFactory.java:192)

at
org.apache.struts.util.MessageResources.getMessageResources(MessageR

sources.java:576)

at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.ja

a:1329)

at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)

at javax.servlet.GenericServlet.init(GenericServlet.java:258)

at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317

 

at org.apache.tomcat.core.Handler.init(Handler.java:215)

at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)

at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadO

StartupInterceptor.java:130)

at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.jav

:491)

at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)

at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)

at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)

 

cannot load servlet name: action: null

2003-07-15 16:44:41 - PoolTcpConnector: Starting HttpConnectionHandler on
8080 2003-07-15 16:44:41 - PoolTcpConnector: Starting Ajp12ConnectionHandler
on 8007

 

 

Unfortunately I am stuck with Java 1.3.1 and Tomcat 3.2.3, so I can't
upgrade these tools. 

 

The Struts 1.1 site and docs claim to be Tomcat 3.2.* compatible. Hmmm. I
have searched far and wide for a solution, and although I have found folks
who have posted the same problem, I have yet to find an answer.

 

Out of curiosity I tried the Struts 1.0.2 "struts-example.war" and it works
fine.

 

Also, I have tried upgrading Tomcat's jaxp to 1.2, and it had no effect.

 

I'm hoping someone on this list might be able to help.

 

Thanks!

 

 



RE: epicentric & struts

2003-07-15 Thread Mark Galbreath
No, epicentric does not work with Struts.  Struts is just fine (without the
friggin Validator).

-Original Message-
From: Charles Liu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 5:46 PM
To: [EMAIL PROTECTED]
Subject: epicentric & struts


Hi all,
I heard that struts doesn't work with epicentric. Is that true?

Thanks a lot!

-- 
Charles Liu



-
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: Splash Screen in Struts

2003-07-15 Thread Aaron Longwell
I'll have to look into this... I know I did it before in a situation 
with frames Javascript was actually executed in some other frame... 
so that the long-loading window could be manipulated by another frame 
(which can always execute javascript even when the other window is loading).



Dhruva B. Reddy wrote:

This doesn't seem to work--nothing after the first submit() call gets
executed.
I assume you put all of this code in the onclick handler for the submit
button.
--- Aaron Longwell <[EMAIL PROTECTED]> wrote:
 

Dhruva,

I have done this before the absolute cleanest implementation is 
almost 100% javascript:

1) Javascript submit(); call to start POST page loading
2) Javascript delete contents of the window
(javascript:document.clear();)
3) Write new content to the window... adding in an  tag to a 
animated GIF (or, cooler a Flash movie)
this is done with one call to document.write(str); You have to
populate 
the str variable first because each document.write causes the window
to 
be cleared and then rewritten.

Item #2 is somewhat optional, but I like it for clarity and I'm a
little 
weird.

Aaron

Dhruva B. Reddy wrote:

   

I have an Action that could potentially take a long time to execute,
and would like to display a splash screen until the results of the
action are ready.
I went googling for this, but I can't seem to find a solution that
would fit within the Struts framework.  Has anyone done this before?
Thanks,
Dhruva
__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
 

-
   

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




 

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



__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 



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


/ /OREF:CPT7E658 nested:nest and all things nested...

2003-07-15 Thread ZTofie

I have a property on a form bean that stores an object that contains
an array list.
The array list contains a wrapper object that contains 4 other
objects - each of a different type.

I try to access the respective properties of each of the four objects
contained in the wrapper object in the following way:





  

  

  

ZAR: 

To be precise:
The propertyList property contains the array list and this array list
is called cachedProperties.

The array list contains PropCargo objects.

Each propCargo object contains a:
  1.  Property object
  2. Features object
  3. Images object
  4. Client object

I want to access properties of these objects in the same
nested:iterate clause by going something like: property
="property.formattedPrice" for example.

Am I doing this correctly or have I missed something?

The HTML table doesn't render.

Tx - help will be greatly appreciated.

Zain



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



RE: epicentric & struts

2003-07-15 Thread michael . korolyov
hi Charles,

I have imlemented some modules based on Struts 1.1 rc1 that I integrated to
Epicentric with out any problems.

yes I had some problems with Epicentric, but that all about links (href)
that Epicentric translates in own way - that is diff. story.

Best Regards.
Michael.


-Original Message-
From: Charles Liu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: epicentric & struts


Hi all,
I heard that struts doesn't work with epicentric. Is that true?

Thanks a lot!

-- 
Charles Liu



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



How do I implement a Master/Detail maintenance form?

2003-07-15 Thread Shane Mingins
Hi

Are there any *best practices* or examples around showing the best way of
implementing the maintenance of a master/detail relationship using the
Struts framework?

For example if I provide a form with a supplier and list of products where
you can edit the supplier details and/or edit the product details, to select
the product to edit I need to provide a key to identify that product.  I can
use a link but then any changes to the supplier are not kept as the link
does not submit the form.

Thanks
Shane


Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



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



epicentric & struts

2003-07-15 Thread Charles Liu
Hi all,
I heard that struts doesn't work with epicentric. Is that true?
Thanks a lot!

--
Charles Liu


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


Re: Splash Screen in Struts

2003-07-15 Thread Dhruva B. Reddy
This doesn't seem to work--nothing after the first submit() call gets
executed.

I assume you put all of this code in the onclick handler for the submit
button.

--- Aaron Longwell <[EMAIL PROTECTED]> wrote:
> Dhruva,
> 
> I have done this before the absolute cleanest implementation is 
> almost 100% javascript:
> 
> 1) Javascript submit(); call to start POST page loading
> 2) Javascript delete contents of the window
> (javascript:document.clear();)
> 3) Write new content to the window... adding in an  tag to a 
> animated GIF (or, cooler a Flash movie)
> this is done with one call to document.write(str); You have to
> populate 
> the str variable first because each document.write causes the window
> to 
> be cleared and then rewritten.
> 
> Item #2 is somewhat optional, but I like it for clarity and I'm a
> little 
> weird.
> 
> Aaron
> 
> Dhruva B. Reddy wrote:
> 
> >I have an Action that could potentially take a long time to execute,
> >and would like to display a splash screen until the results of the
> >action are ready.
> >
> >I went googling for this, but I can't seem to find a solution that
> >would fit within the Struts framework.  Has anyone done this before?
> >
> >Thanks,
> >Dhruva
> >
> >__
> >Do you Yahoo!?
> >SBC Yahoo! DSL - Now only $29.95 per month!
> >http://sbc.yahoo.com
> >
>
>-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >  
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: Is this really the best way to handle this problem

2003-07-15 Thread Linus Nikander
First off, thank you for the reply.

As you point out both solutions that you suggest have a certain hackishness
over them it would be nice to avoid. As displaying data from a DB-table,
allowing that data to be edited (en masse, not one record at a time), must
be a pretty common task, doesn't anyone have a more elegant solution when
using struts ?

//Linus


"John M. Corro" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've seen two ways of dealing w/ this problem, both of which I see as
'hackish'
> in nature.
>
> Solution A:
>
> In your getters/setters you implement the following code
>
> public MyCustomBean getMyCustomBean(int index) {
>while(index >= myCustomBeanList.size()) {
>   myCustomBeanList.add(new MyCustomBean());
>}
>return (MyCustomBean)myCustomBeanList.get(index);
> }
>
> In that way you'll never encounter the common IndexOutOfBoundsException.
The
> problem here is that you tend to use alot of hidden fields in your UI to
repopulate
> the data back into the dynamically created beans.
>
> Solution B:
>
> In your reset() method you repopulate your internal Collection of beans.
The
> problem w/ this approach is that often times you have a separate Action
that
> prepopulates your ActionForm.  This provides for good separation - the
Action
> is a retriever of a data (nothing more) and the ActionForm is merely a
container
> for data (nothing more).  With this approach your ActionForm suddenly
starts
> becoming more intelligent than it really should be.  Now it's aware of how
to
> populate itself...not a good thing IMO.
>
> I'd be very interested in hearing other solutions to this problem as I
find
> both of the above solutions cumbersome and hackish and would love to stop
implementing
> them.
>
> >I've been struggling with a problem similar to the one described (and
> >solved) at
> >http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html

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



Re: [OT] auto convert resource property files to different language

2003-07-15 Thread Dichotomy
That, or you can always sub-contract the translation works. Translators are not 
exactly hard to find, and anyone who even barely knows the language is likely to do a 
better job than any translation program. If the sales people were not complete morons 
they made sure that each extra language results in more money coming your way (to pay 
for the sub-contracting costs and to give you some profit on it).

-- 
If education is too expensive, try ignorance.


On Tue, 15 Jul 2003 15:45:50 -0400
"Paananen, Tero" <[EMAIL PROTECTED]> wrote:

> > i totally know the difficulty of language translation
> > so was just curious to find out what the other
> > developers do about language translation, i cannot
> > learn the other language or dont want to spent time
> > translating property files to other language, if some
> > one really needs it i will give him the english file
> > and ask him to translate to his language, 
> 
> Document the functionality and the process of providing
> support for different languages, then hand the documentation
> to the client (whether external or internal).
> 
> If the client is external, I hope to God your salespeople
> included the translation as one of the tasks the client
> is responsible for.
> 
>   -TPP
> 
> -
> This email may contain confidential and privileged material for the sole use of the 
> intended recipient(s). Any review, use, retention, distribution or disclosure by 
> others is strictly prohibited. If you are not the intended recipient (or authorized 
> to receive for the recipient), please contact the sender by reply email and delete 
> all copies of this message.  Also, email is susceptible to data corruption, 
> interception, tampering, unauthorized amendment and viruses. We only send and 
> receive emails on the basis that we are not liable for any such corruption, 
> interception, tampering, amendment or viruses or any consequence thereof.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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



Re: [OT] Java Script Confirm and struts

2003-07-15 Thread Dichotomy
But googling takes effort! Asking a mailing list is so much easier :-)

-- 
If education is too expensive, try ignorance.

On Tue, 15 Jul 2003 13:40:26 -0500
Jarnot Voytek Contr AU HQ/SC <[EMAIL PROTECTED]> wrote:

> http://www.google.com/search?q=javascript+confirm
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 15, 2003 1:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: Java Script Confirm and struts
> > 
> > 
> > Hi i wud like to have a confirm box that displays a message saying
> > 
> > " make sure all the values are correct, once it is submitted 
> > it cannot be
> > take back"
> > 
> > I want to have this when a user clicks a "continue" on a JSP 
> > page, if the
> > user clicks "yes" on the continue box it shud submit the form 
> > but if the
> > user
> > clicks "no" then the form shud not be submitted.I started 
> > writing it but i
> > donno what to
> > 
> >   
> > 
> > what do i need to write for the onclick for what i need to happen.
> > 
> > 
> > --Thanx in advance
> >Mohan
> > 
> > 
> > 
> > -
> > 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: Splash Screen in Struts

2003-07-15 Thread michael . korolyov
Aaron,

what will happen when server action takes 1-5 min?
user may get TIMEOUT ...

tnx

-Original Message-
From: Aaron Longwell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 1:27 PM
To: Struts Users Mailing List
Subject: Re: Splash Screen in Struts


Dhruva,

I have done this before the absolute cleanest implementation is 
almost 100% javascript:

1) Javascript submit(); call to start POST page loading
2) Javascript delete contents of the window (javascript:document.clear();)
3) Write new content to the window... adding in an  tag to a 
animated GIF (or, cooler a Flash movie)
this is done with one call to document.write(str); You have to populate 
the str variable first because each document.write causes the window to 
be cleared and then rewritten.

Item #2 is somewhat optional, but I like it for clarity and I'm a little 
weird.

Aaron

Dhruva B. Reddy wrote:

>I have an Action that could potentially take a long time to execute,
>and would like to display a splash screen until the results of the
>action are ready.
>
>I went googling for this, but I can't seem to find a solution that
>would fit within the Struts framework.  Has anyone done this before?
>
>Thanks,
>Dhruva
>
>__
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>  
>


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

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



mask validation.

2003-07-15 Thread Aleksander . Matijara
Hi there,

I am doing a mask validation for the phone - using the 'standard' regex 
pattern:


phone
^(\d{3})[-| ]?(\d{4})$
 

.
.




mask
${phone}
 


Now, I have noticed that if no phone number is entered, it passes the 
Javascript
validation (I  have no "required" validation dependency for this field). 
So, Javascript
let's it go, but, the Server side validation fails - so it displays an 
error message saying
that no phone number has been entered.  What gives??  Why am I getting a 
'server side'
validation error and Javascript seems to let it go.  Perhaps I should 
change the regex
pattern to allow empty string, but I am not sure how to do that.  I am 
using IBM WSAD 5.0x

Thanks, Aleks.


RE: login framework

2003-07-15 Thread Amit Kirdatt
HttpServletRequest has a method called getHeader(String name) use that with
a paramater of "Referer" which will give you the page the user came from.
Look at the Servlet specification for all your other answers.

--Amit

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 2:42 PM
To: [EMAIL PROTECTED]
Subject: login framework


Hi,
I have a following requirement, 
there are 2 links on a webpage, when the user clicks
on 1st link show the user login screen if he is not
logged in( ihave login info in session), if the login
is valid forward the request to 1st html page, 
if the user clicks on 2nd link, again show the login
screen (if not logged in), and if the login is valid
forward the request to 2nd html page.
So how do i define in struts-config file to handle
this, 
I want some mechanism to remember from which page the
request came and which page is must be redirected, and
what where the parameters in the request.
It is some thing like on ebay, where the user has to
login each time he tries to checkout

Any suggestions about it

Ashish

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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



Re: Splash Screen in Struts

2003-07-15 Thread Aaron Longwell
Dhruva,

I have done this before the absolute cleanest implementation is 
almost 100% javascript:

1) Javascript submit(); call to start POST page loading
2) Javascript delete contents of the window (javascript:document.clear();)
3) Write new content to the window... adding in an  tag to a 
animated GIF (or, cooler a Flash movie)
this is done with one call to document.write(str); You have to populate 
the str variable first because each document.write causes the window to 
be cleared and then rewritten.

Item #2 is somewhat optional, but I like it for clarity and I'm a little 
weird.

Aaron

Dhruva B. Reddy wrote:

I have an Action that could potentially take a long time to execute,
and would like to display a splash screen until the results of the
action are ready.
I went googling for this, but I can't seem to find a solution that
would fit within the Struts framework.  Has anyone done this before?
Thanks,
Dhruva
__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 



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


Logging error message

2003-07-15 Thread Ryan Cuprak

 Does anyone know how to solve the exception trace below? Both commons
logging and log4j are in the lib directory. Is this a class loading problem?

 -Ryan


avax.servlet.ServletException
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:471)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:359)
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.ja
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.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1027)
at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
)
at java.lang.Thread.run(Thread.java:554)

root cause 
java.lang.ExceptionInInitializerError
at org.apache.struts.taglib.html.HtmlTag. (HtmlTag.java:94)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:68)
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.ja
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.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at 
org.

RE: Splash Screen in Struts ("Please Wait" page) (Cont'd, sorry)

2003-07-15 Thread James Childers
> -Original Message-
> From: James Childers 
> Sent: Tuesday, July 15, 2003 2:59 PM
> To: Struts Users Mailing List
> Subject: RE: Splash Screen in Struts ("Please Wait" page)
> 
> 
> Yes.
> 
> "But beware O Man, beware, of Those who tread in Darkness the 
> ramparts of Kadath, for he that beholds Their mitred-heads 
> shall know the claws of doom."
> 
> I've actually been struggling with this for a while now, and 
> have come up with a solution that (mostly) works, but it has 
> been difficult.
> 
> Our requirements were:
> 
> 1) Display a happy little animation for the user's benefit
> 2) Have browser's "throbber" throb while the "wait" page is displayed
> 3) Work within the Struts framework
> 4) Being a good netizen, you want this to work on different browsers
> 
> The best solution I have found is to extend ActionServlet and 
> ActionMapping in order to add a "please wait" flag to both 
> via struts-config. Your WaitActionMapping would simply have 
> 
> private boolean showWaitPage = false;
> 
> with the appropriate getter and setters in it. You would then 
> set this parameter via struts-config and be done with that part of it.
> 
> In WaitActionServlet you would check the showWaitPage value 
> for that mapping, and if true you would at this point show 
> the splash screen using (!) out.prints. After this you would 
> do an out.flush(), which would show the splash screen to the 
> user but leave the connection open.
> 
> Now you do your heavy-duty task, probably in a separate 
> thread, and check it occasionally from within 
> WaitActionServlet. If it's done, you send some JavaScript to 
> overwrite the splash screen and forward to the appropriate 
> JSP as defined in your struts-config.
> 
> Now, this is all completely theoretical, because our rather 
> expensive servlet container has an extremely irritating bug 
> that causes out.flush() to not work. The solution we 
> implemented involves 

subclassing Action and adding a parameter to the session that indicates if the task is 
done or not. The JSP has a meta-refresh tag in the  section that submits to the 
Action every couple of seconds; the Action checks to see if the task is done. If so, 
it forwards to the "success" JSP. If not, it forwards to the "wait" page again.

-= J

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



Re: Splash Screen in Struts

2003-07-15 Thread Dhruva B. Reddy
OK, let me ask this:

Let's say that I have input.jsp, which goes to longAction.do, which in
turn forwards to long_results.jsp when finished.  I've noticed that the
contents of input.jsp remain displayed after the submit button is
clicked, until the contents of input.jsp are ready for the browser to
load.

I have tried to take advantage of this by creating an intermediate
action, splashAction.do, which forwards to splash.jsp, which in turn
forwards to longAction.do (I have a jsp:forward tag at the end of
splash.jsp).  splashAction.do is invoked by the submit button on
input.jsp.  I would expect the contents of splash.jsp to be displayed
until the contents of long_results.jsp are ready for display. Yet the
contents of input.jsp remain displayed until long_results.jsp is ready,
just as before--I never see splash.jsp.

Can anyone tell me why this didn't work?

Thanks,
Dhruva

--- "Dhruva B. Reddy" <[EMAIL PROTECTED]> wrote:
> I have an Action that could potentially take a long time to execute,
> and would like to display a splash screen until the results of the
> action are ready.
> 
> I went googling for this, but I can't seem to find a solution that
> would fit within the Struts framework.  Has anyone done this before?
> 
> Thanks,
> Dhruva
> 
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: Splash Screen in Struts ("Please Wait" page)

2003-07-15 Thread James Childers
Yes.

"But beware O Man, beware, of Those who tread in Darkness the ramparts of Kadath, for 
he that beholds Their mitred-heads shall know the claws of doom."

I've actually been struggling with this for a while now, and have come up with a 
solution that (mostly) works, but it has been difficult.

Our requirements were:

1) Display a happy little animation for the user's benefit
2) Have browser's "throbber" throb while the "wait" page is displayed
3) Work within the Struts framework
4) Being a good netizen, you want this to work on different browsers

The best solution I have found is to extend ActionServlet and ActionMapping in order 
to add a "please wait" flag to both via struts-config. Your WaitActionMapping would 
simply have 

private boolean showWaitPage = false;

with the appropriate getter and setters in it. You would then set this parameter via 
struts-config and be done with that part of it.

In WaitActionServlet you would check the showWaitPage value for that mapping, and if 
true you would at this point show the splash screen using (!) out.prints. After this 
you would do an out.flush(), which would show the splash screen to the user but leave 
the connection open.

Now you do your heavy-duty task, probably in a separate thread, and check it 
occasionally from within WaitActionServlet. If it's done, you send some JavaScript to 
overwrite the splash screen and forward to the appropriate JSP as defined in your 
struts-config.

Now, this is all completely theoretical, because our rather expensive servlet 
container has an extremely irritating bug that causes out.flush() to not work. The 
solution we implemented involves 



> -Original Message-
> From: Dhruva B. Reddy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 2:23 PM
> To: Struts Users Mailing List
> Subject: Splash Screen in Struts
> 
> I have an Action that could potentially take a long time to execute,
> and would like to display a splash screen until the results of the
> action are ready.
> 
> I went googling for this, but I can't seem to find a solution that
> would fit within the Struts framework.  Has anyone done this before?
> 
> Thanks,
> Dhruva
> 
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re: html:select

2003-07-15 Thread Dhruva B. Reddy
Use the "name" attribute on "html:select" to refer to a bean which
contains this property (as described by the "property" attribute).

--- Sloan Seaman <[EMAIL PROTECTED]> wrote:
> If a user selects something from a html:select field and the next
> time the pages loads I want to get the value that they selected, how
> do I go about do this?
> 
> I know that if I used  struts would select the correct
> option for me, but in my case the  tags get populated
> everytime by javascript so I need to get the selected option value
> from the bean that was set by struts...
> 
> Thanks!!
> 
> --
> Sloan
> 
> 
>

> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
>



__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: [OT]RE: Iterating the resultset contents in the view (jsp)

2003-07-15 Thread Vijay Balakrishnan
I read recently that you can convert from a Javabean to an xml file using
Digester with a dtd.I was wondering if there was a way to convert directly
from a sql resultset into an xml file without going through an intermediary
step of a javabean or custom formatting.

Thanks,
Vijay

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 11:55 AM
To: Struts Users Mailing List
Subject: Re: [OT]RE: Iterating the resultset contents in the view (jsp)


--- Vijay Balakrishnan <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there a way to return this resultset from a SQL Query as an xml 
> file using a beanutils class or Digester ?

I don't know of any class that does that.  Every application will require
its own XML format anyways.

David

> 
> Thanks,
> Vijay
> 
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 14, 2003 7:25 PM
> To: Struts Users Mailing List
> Subject: Re: Iterating the resultset contents in the view (jsp)
> 
> 
> 
> 
> On Mon, 14 Jul 2003, Richard Hill wrote:
> 
> > Date: Mon, 14 Jul 2003 16:36:17 -0700
> > From: Richard Hill <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: "'[EMAIL PROTECTED]'"
> > <[EMAIL PROTECTED]>
> > Subject: Iterating the resultset contents in the view (jsp)
> >
> > Hi,
> > I'm working on an action that gets a resultset from a database table
> > containing 4 columns. I need to pass that information back to the view
> 
> > (jsp) which will iterate over results. My question is what is the 
> > best
> 
> > way to do this. Do I create an array for each row in the resultset 
> > and
> 
> > insert each array in a collection, passing that back to the view?
> >
> 
> That is certainly one approach.  Indeed, commons-beanutils has a 
> useful little class (org.apache.commons.beanutils.RowSetDynaClass) 
> that is ideally suited to this use case.  It creates a List of 
> DynaBeans representing the
> data content returned by the SELECT.  Because it makes a copy, you can
> close
> the result set (and return the connection back to the connection pool)
> before forwarding to the page.
> 
> > If so, how would you iterate over each array in the collection with
> > the logic:iterate taglib? All of the examples only show iterations 
> > over single column lists.
> >
> 
> Let's assume you have done this in your Action:
> 
>   ResultSet rs = ...;
>   RowSetDynaClass rsdc = new RowSetDynaClass(rs);
>   rs.close();
>   request.setAttribute("customers", rsdc.getList());
> 
> so you now have a request attribute containing the list.  Now, in your 
> page, you can say things like:
> 
>   
> Name is 
> Status is 
>   
> 
> and so on.  Details of RowSetDynaClass are in the javadocs for
> BeanUtils:
> 
>   http://jakarta.apache.org/commons/beanutils/
> 
> > Any help would be appreciated.
> >
> > Thanks,
> > Richard
> >
> 
> Craig
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com

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

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



Re: how to get both values and text for option?

2003-07-15 Thread Brown, Melonie S. - Contractor
Instead of a String[], try a List that is populated with label value beans
and use the indexed properties to access individual elements. 


  


   

 

See http://jakarta.apache.org/struts/faqs/indexedprops.html for more details

 Original Message 
Subject: how to get both values and text for  option?
Date: Tue, 15 Jul 2003 14:21:50 -0400
From: Jung, Eric (Contractor) <[EMAIL PROTECTED]>
Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
Newsgroups: gmane.comp.jakarta.struts.user

Hi,
I've searched the FAQ and the archives, but can't find an answer to this
question. I'm know it's been asked before, but part of my problem seems to
be that the mail-archive search tool doesn't like colons or < > characters
(so searching for  becomes difficult). Try as I may, I'm not
able to find an answer.

I'm trying to get both the values and the text of the selected
 in an . It appears that right now I'm only
getting one (the values, I think, but not the text) in my ActionForm's
String array:

  public class MappingForm extends ActionForm {
private String [] columns;
//getColumns() and setColumns() removed for brevity
...
  }


  one
  two


In other words, I'm only getting "a" and "b" in my array. However, I'd like
to have another String array, or a 2-dimensional String array, that receives
both "a", "one", and "b", "two".

Any help would be greatly appreciated. Thanks in advance.

Sincerely,

Eric H. Jung
Software Engineer
Russell/Mellon Analytical Services
1-617-382-1373
Everett, MA, USA
[EMAIL PROTECTED]


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



RE: [OT] auto convert resource property files to different langua ge

2003-07-15 Thread Paananen, Tero
> i totally know the difficulty of language translation
> so was just curious to find out what the other
> developers do about language translation, i cannot
> learn the other language or dont want to spent time
> translating property files to other language, if some
> one really needs it i will give him the english file
> and ask him to translate to his language, 

Document the functionality and the process of providing
support for different languages, then hand the documentation
to the client (whether external or internal).

If the client is external, I hope to God your salespeople
included the translation as one of the tasks the client
is responsible for.

-TPP

-
This email may contain confidential and privileged material for the sole use of the 
intended recipient(s). Any review, use, retention, distribution or disclosure by 
others is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete all 
copies of this message.  Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive emails on the 
basis that we are not liable for any such corruption, interception, tampering, 
amendment or viruses or any consequence thereof.


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



Re: [OT]RE: Iterating the resultset contents in the view (jsp)

2003-07-15 Thread Kris Schneider
I'm not sure about other DB vendors, but Oracle provides an XML Developer's Kit
that includes:

XML SQL Utility: supporting Java, generates XML documents, DTDs and Schemas from
SQL queries.

Haven't used it before but it might be worth a look:

http://otn.oracle.com/tech/xml/xdkhome.html

The roll-your-own approach generally involves using ResultSetMetaData to
dynamically build an XML doc that "looks" something like:


  

Joe
Foo
...
  
  ...


I don't have a specific reference handy, but you should be able to find some
example code floating around the net...

Quoting David Graham <[EMAIL PROTECTED]>:

> --- Vijay Balakrishnan <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > Is there a way to return this resultset from a SQL Query as an xml file
> > using a beanutils class or Digester ?
> 
> I don't know of any class that does that.  Every application will require
> its own XML format anyways.
> 
> David
> 
> > 
> > Thanks,
> > Vijay
> > 
> > -Original Message-
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, July 14, 2003 7:25 PM
> > To: Struts Users Mailing List
> > Subject: Re: Iterating the resultset contents in the view (jsp)
> > 
> > 
> > 
> > 
> > On Mon, 14 Jul 2003, Richard Hill wrote:
> > 
> > > Date: Mon, 14 Jul 2003 16:36:17 -0700
> > > From: Richard Hill <[EMAIL PROTECTED]>
> > > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > > To: "'[EMAIL PROTECTED]'" 
> > > <[EMAIL PROTECTED]>
> > > Subject: Iterating the resultset contents in the view (jsp)
> > >
> > > Hi,
> > > I'm working on an action that gets a resultset from a database table 
> > > containing 4 columns. I need to pass that information back to the view
> > 
> > > (jsp) which will iterate over results. My question is what is the best
> > 
> > > way to do this. Do I create an array for each row in the resultset and
> > 
> > > insert each array in a collection, passing that back to the view?
> > >
> > 
> > That is certainly one approach.  Indeed, commons-beanutils has a useful
> > little class (org.apache.commons.beanutils.RowSetDynaClass) that is
> > ideally
> > suited to this use case.  It creates a List of DynaBeans representing
> > the
> > data content returned by the SELECT.  Because it makes a copy, you can
> > close
> > the result set (and return the connection back to the connection pool)
> > before forwarding to the page.
> > 
> > > If so, how would you iterate over each array in the collection with 
> > > the logic:iterate taglib? All of the examples only show iterations 
> > > over single column lists.
> > >
> > 
> > Let's assume you have done this in your Action:
> > 
> >   ResultSet rs = ...;
> >   RowSetDynaClass rsdc = new RowSetDynaClass(rs);
> >   rs.close();
> >   request.setAttribute("customers", rsdc.getList());
> > 
> > so you now have a request attribute containing the list.  Now, in your
> > page,
> > you can say things like:
> > 
> >   
> > Name is 
> > Status is 
> >   
> > 
> > and so on.  Details of RowSetDynaClass are in the javadocs for
> > BeanUtils:
> > 
> >   http://jakarta.apache.org/commons/beanutils/
> > 
> > > Any help would be appreciated.
> > >
> > > Thanks,
> > > Richard
> > >
> > 
> > Craig

-- 
Kris Schneider 
D.O.Tech   

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



login framework

2003-07-15 Thread Ashish Kulkarni
Hi,
I have a following requirement, 
there are 2 links on a webpage, when the user clicks
on 1st link show the user login screen if he is not
logged in( ihave login info in session), if the login
is valid forward the request to 1st html page, 
if the user clicks on 2nd link, again show the login
screen (if not logged in), and if the login is valid
forward the request to 2nd html page.
So how do i define in struts-config file to handle
this, 
I want some mechanism to remember from which page the
request came and which page is must be redirected, and
what where the parameters in the request.
It is some thing like on ebay, where the user has to
login each time he tries to checkout

Any suggestions about it

Ashish

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: Java Script Confirm and struts

2003-07-15 Thread mohan
Thank you guys it works just by putting the return in there...thanks again

--Mohan
>
> Mohan,
>
>
> Try this
> 
>
>
> marcos
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:28 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Java Script Confirm and struts
>
> Hi did as u guys said but it submits the page anyway, i want the page
> not
> submitted if i press the cancel button.It submits the page if press OK
> or
> Cancel This is what i did...
>
>
> 
>   function confirmSubmit(){
>   var agree=confirm("Make Sure all the Values are correct,
> once submitted
> this form cannot be take back");
>   if(agree)
>   return true;
>   else
>   return false;
>   }
> 
>
> 
>
> --Thanx in advance
>
>> onclick="return confirm('Your message here')"
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, July 15, 2003 12:39 PM
>> To: [EMAIL PROTECTED]
>> Subject: Java Script Confirm and struts
>>
>>
>> Hi i wud like to have a confirm box that displays a message saying
>>
>> " make sure all the values are correct, once it is submitted it cannot
>> be take back"
>>
>> I want to have this when a user clicks a "continue" on a JSP page, if
>> the user clicks "yes" on the continue box it shud submit the form but
> if
>> the user
>> clicks "no" then the form shud not be submitted.I started writing it
> but
>> i donno what to
>>
>>   
>>
>> what do i need to write for the onclick for what i need to happen.
>>
>>
>> --Thanx in advance
>>Mohan
>>
>>
>>
>> -
> 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: mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Michael Muller

I'm not saying anything about Cavaness' book. I haven't read it so I cannot comment :-) I'm just saying you can get the Input forward easily this way.
well, i'm not looking for a critique of the book, i'm just saying this 
code looks broken.

return mapping.findForward( mapping.getInput() );

as you point out below, findForward takes as an argument the name of a 
forward.  the input attrubute on an action mapping, however, is a page.

2) Yes, the forward can point to any resource, from a tiles definition to a jsp or an action url (I'm talking about the value you put in the  bit).
but you can't stick in a forward, correct?  this is very confusing, that 
you say forward= and then you can give it almost anything EXCEPT a 
forward.  :(


Well the thing is that tag is *defining* a forward, so if you're trying to put another forward in the path= property then you're doing something wrong, cause if that other forward is accessible from this action, then you don't need to define it again!!
i just think the attribute name is unfortunate.  "forwardTo" might be 
better, for instance.

  -- mike



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


RE: Java Script Confirm and struts

2003-07-15 Thread Jimmy Emmanual
1. Change the html:submit to html:text

2. pass the form to the script and then submit


 function confirmSubmt(form) {
   var agree=confirm("Make Sure all the Values are correct, once submitted
this form cannot be take back");

   if (agree)
  form.submit();
   else
  return false;
 }


3. change onClick to pass the form.
   onClick="confirmSubmit(this.form)"

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 3:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Java Script Confirm and struts


Hi did as u guys said but it submits the page anyway, i want the page not
submitted if i press the cancel button.It submits the page if press OK or
Cancel This is what i did...



function confirmSubmit(){
var agree=confirm("Make Sure all the Values are correct,
once submitted
this form cannot be take back");
if(agree)
return true;
else
return false;
}




--Thanx in advance

> onclick="return confirm('Your message here')"
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: Java Script Confirm and struts
>
>
> Hi i wud like to have a confirm box that displays a message saying
>
> " make sure all the values are correct, once it is submitted it cannot
> be take back"
>
> I want to have this when a user clicks a "continue" on a JSP page, if
> the user clicks "yes" on the continue box it shud submit the form but if
> the user
> clicks "no" then the form shud not be submitted.I started writing it but
> i donno what to
>
>   
>
> what do i need to write for the onclick for what i need to happen.
>
>
> --Thanx in advance
>Mohan
>
>
>
> - 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: [OT] colours

2003-07-15 Thread Brown, Melonie S. - Contractor
I do some webdesign as well, and that link was referenced on another mailing
list that I subscribe to.  It wouldn't be google-able because the archives
aren't posted on the web.

Here's some other links that I have found helpful:

http://www.webstandards.org/ 
http://www.zeldman.com/
http://www.meyerweb.com/
http://www.csszengarden.com/ 
http://www.css-discuss.org/

 Original Message 
Subject: Re: [OT] colours
Date: Thu, 10 Jul 2003 15:29:21 +0200
From: Adam Hardy <[EMAIL PROTECTED]>
Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
Newsgroups: gmane.comp.jakarta.struts.user
References:
<[EMAIL PROTECTED]>

How do you find these things? I searched google and got nowhere.

Brown, Melonie S. - Contractor wrote:
> I like http://www.defencemechanism.com/color/color_toy_fr.htm
> 
> Adam Hardy wrote:
>  > I'm doing the HTML design for my current project and I'm looking for
>  > some resource on the web somewhere that will show me what colours go
>  > together well, i.e. sets of 2 or 3 colours that contrast pleasingly.
>  >
>  > I saw someone post a button site called 'steal these'
>  > _http://gtmcknight.com/buttons/index.php_ where the buttons had colour
>  > pairs - I'm wondering if there's something else out there that will
help
>  > me avoid my normal tasteless schemes - gan-green with ultra-violet for
>  > instance.
>  >
>  > Thanks,
>  > Adam
> 
> 
> 
> 
> -
> 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]



html:select

2003-07-15 Thread Sloan Seaman
If a user selects something from a html:select field and the next time the pages loads 
I want to get the value that they selected, how do I go about do this?

I know that if I used  struts would select the correct option for me, but 
in my case the  tags get populated everytime by javascript so I need to get 
the selected option value from the bean that was set by struts...

Thanks!!

--
Sloan



This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com


Re: Splash Screen in Struts

2003-07-15 Thread Yann Cébron
> I have an Action that could potentially take a long time to execute,
> and would like to display a splash screen until the results of the
> action are ready.
>
> I went googling for this, but I can't seem to find a solution that
> would fit within the Struts framework.  Has anyone done this before?
>

Found this article: "JSP Progress Bars"

http://www.onjava.com/pub/a/onjava/2003/06/11/jsp_progressbars.html


This might be interesting, too (but maybe too much for your needs):

http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html?

There's also some tricks with JavaScript and/or HTML-META-REFRESH tags,
search the user-list..


HTH,
Yann




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



RE: How do you access an application.properties value directly fr om within a class?

2003-07-15 Thread Chen, Gin
yuk how about a much cleaner way using jstl?






Where ApplicationResources is the the name without .properties suffix.
-Tim

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 2:53 PM
To: 'Struts Users Mailing List'
Subject: RE: How do you access an application.properties value directly
fr om within a class?


Or how about an ugly way? ;-)

<%@ page import="org.apache.struts.util.MessageResources,
 org.apache.struts.action.Action"%>

<% 
MessageResources resources = 
(MessageResources) request.getAttribute(Action.MESSAGES_KEY); 
%>

<%=resources.getMessage("userForm.userId")%>

Matt

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 12:04 PM
To: Struts Users Mailing List
Subject: Re: How do you access an application.properties value directly
from within a class?


You mean like this?


 




--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
678-910-8017
AIM:jmitchtx


- Original Message -
From: "Mike Deegan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 1:53 PM
Subject: Re: How do you access an application.properties value directly from
within a class?


> Hey Matt / All,
>
> Do you have an elegant way -  in scriptlet form - at the JSP level to grab
> an application.properties value to then use as a JSP expression (
<%=...%>)
> in the "value" attribute of a tag.
>
> I had tried to use the bean:message tag to get the "value" to populate
into
> the "value" attribute of another tag - that is when trying to combine two
> tags - but the page fails to compile. Can't remember the exact error msg
but
> it was along the lines of " = expected ..."
>
> I know you can use JSP expressions ( <%=...%>) in the "value" attribute of
> tags - but JSP compile fails when I try to use bean:message tag to
directly
> populate a tag's "value" attribute.
>
> So do you have an elegant way -  in scriptlet form - at the JSP level to
> grab an application.properties value to then use as a JSP expression (
> <%=...%>) in the "value" attribute of a tag.
>
> I searched for some time for an answer on this but got lost in the maze.
> Maybe the wording of my searches let me down.
>
> Or should I be attempting to do this in another way ... without scriptlets
> ... to get an application.properties value to populate into the "value"
> attribute of another tag.
>
> Any help appreciated ...
> Mike
>
> - Original Message -
> From: "Raible, Matt" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 15, 2003 10:53 AM
> Subject: RE: How do you access an application.properties value directly fr
> om within a class?
>
>
> > I forgot to add the simplest way in an Action class:
> >
> > MessageResources resources = getResources(request);
> >
> > resources.getMessage("keyName");
> >
> >
> > -Original Message-
> > From: Raible, Matt
> > Sent: Tuesday, July 15, 2003 10:51 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: How do you access an application.properties value directly
> > fr om within a class?
> >
> >
> > If you're just looking for the values, grab it as a resource bundle.
> Here's
> > how I grab it in a Business Delegate:
> >
> > // Get the application's messages resources
> > ResourceBundle resources =
> > ResourceBundle.getBundle("ApplicationResources");
> > String appDBVersion = resources.getString("webapp.db_version");
> >
> > And then of course, there's errors and messages - where it grabs it
> > automagically:
> >
> > errors.add(ActionErrors.GLOBAL_ERROR,
> >new ActionError("errors.existing.user",
> >userForm.getUsername(),
> >userForm.getEmail()));
> >
> > messages.add(ActionMessages.GLOBAL_MESSAGE,
> >  new ActionMessage("user.deleted",
> > userForm.getEmail()));
> >
> > And lastly, you can get it from the servlet context in a servlet outside
> of
> > struts:
> >
> > MessageResources resources =
> > ((MessageResources)
> > getServletContext().getAttribute(Globals.MESSAGES_KEY));
> >
> > resources.getMessage("userFormEx.username");
> >
> >
> > HTH,
> >
> > Matt
> >
> > -Original Message-
> > From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 15, 2003 10:28 AM
> > To: 'Struts Users Mailing List'
> > Subject: How do you access an application.properties value directly from
> > within a class?
> >
> >
> > When Struts load, it grabs application.properties and stores it's keys
and
> > values somewhere.  From within an action class I need to access a value
in
> > application.properties.  How could one do this?
> >
> > tia,
> > mark
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >

RE: Java Script Confirm and struts

2003-07-15 Thread Marcos Oliva

Mohan, 


Try this 
 


marcos

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 12:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Java Script Confirm and struts

Hi did as u guys said but it submits the page anyway, i want the page
not
submitted if i press the cancel button.It submits the page if press OK
or
Cancel This is what i did...



function confirmSubmit(){
var agree=confirm("Make Sure all the Values are correct,
once submitted
this form cannot be take back");
if(agree)
return true;
else
return false;
}




--Thanx in advance

> onclick="return confirm('Your message here')"
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: Java Script Confirm and struts
>
>
> Hi i wud like to have a confirm box that displays a message saying
>
> " make sure all the values are correct, once it is submitted it cannot
> be take back"
>
> I want to have this when a user clicks a "continue" on a JSP page, if
> the user clicks "yes" on the continue box it shud submit the form but
if
> the user
> clicks "no" then the form shud not be submitted.I started writing it
but
> i donno what to
>
>   
>
> what do i need to write for the onclick for what i need to happen.
>
>
> --Thanx in advance
>Mohan
>
>
>
> -
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: Java Script Confirm and struts

2003-07-15 Thread Chen, Gin

should be

-Tim

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 3:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Java Script Confirm and struts


Hi did as u guys said but it submits the page anyway, i want the page not
submitted if i press the cancel button.It submits the page if press OK or
Cancel This is what i did...



function confirmSubmit(){
var agree=confirm("Make Sure all the Values are correct,
once submitted
this form cannot be take back");
if(agree)
return true;
else
return false;
}




--Thanx in advance

> onclick="return confirm('Your message here')"
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: Java Script Confirm and struts
>
>
> Hi i wud like to have a confirm box that displays a message saying
>
> " make sure all the values are correct, once it is submitted it cannot
> be take back"
>
> I want to have this when a user clicks a "continue" on a JSP page, if
> the user clicks "yes" on the continue box it shud submit the form but if
> the user
> clicks "no" then the form shud not be submitted.I started writing it but
> i donno what to
>
>   
>
> what do i need to write for the onclick for what i need to happen.
>
>
> --Thanx in advance
>Mohan
>
>
>
> - 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: Java Script Confirm and struts

2003-07-15 Thread mohan
Hi did as u guys said but it submits the page anyway, i want the page not
submitted if i press the cancel button.It submits the page if press OK or
Cancel This is what i did...



function confirmSubmit(){
var agree=confirm("Make Sure all the Values are correct, once submitted
this form cannot be take back");
if(agree)
return true;
else
return false;
}




--Thanx in advance

> onclick="return confirm('Your message here')"
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: Java Script Confirm and struts
>
>
> Hi i wud like to have a confirm box that displays a message saying
>
> " make sure all the values are correct, once it is submitted it cannot
> be take back"
>
> I want to have this when a user clicks a "continue" on a JSP page, if
> the user clicks "yes" on the continue box it shud submit the form but if
> the user
> clicks "no" then the form shud not be submitted.I started writing it but
> i donno what to
>
>   
>
> what do i need to write for the onclick for what i need to happen.
>
>
> --Thanx in advance
>Mohan
>
>
>
> - 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: Tiles and <%@ taglib>

2003-07-15 Thread Erez Efrati
I want to make sure I got you right. So, you mean you put in each JSP
tile its required <[EMAIL PROTECTED]> taglibs?

Erez



-Original Message-
From: Chen, Gin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 7:01 PM
To: 'Struts Users Mailing List'
Subject: RE: Tiles and <%@ taglib>

That's a matter of preference and application server capabilities.
I prefer to keep them all in the same layout.jsp but I'm using
jboss-3.2.0
with jetty and it doesn't support it that way.
>From what I know, only JRun currently supports that option. (Correct me
if
I'm wrong someone).
Once you find an application server that supports both styles, however,
it
really becomes a matter of preference.
-Tim

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 1:56 PM
To: 'Struts Users Mailing List'
Subject: Tiles and <%@ taglib>



In tiles, where should I be best putting the <%@ taglib uri="required
lib" %>? Each tile jsp with its own tags or put them all in the layout
JSP I use?

Thanks,
Erez




-
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: [OT] auto convert resource property files to different langua ge

2003-07-15 Thread Ashish Kulkarni
i totally know the difficulty of language translation
so was just curious to find out what the other
developers do about language translation, i cannot
learn the other language or dont want to spent time
translating property files to other language, if some
one really needs it i will give him the english file
and ask him to translate to his language, 

--- "Kamholz, Keith   (corp-staff) USX"
<[EMAIL PROTECTED]> wrote:
> I can't believe people actually ask for this kind of
> thing.  Completely
> ridiculous.
> It's hard to believe that someone fluent enough in
> computers to use struts
> wouldn't have a grasp of the difficulty of language
> translation.
> 
> 
> -Original Message-
> From: Kearney, Michael
> [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:52 PM
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] auto convert resource property
> files to different
> langua ge
> 
> 
> You've just asked for the Holy Grail of language
> translation.
> I don't think that tool exists yet.  There are
> companies that
> provide that service.
> 
>   -Michael
> 
> -Original Message-
> From: Ashish Kulkarni
> [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 10:21 AM
> To: [EMAIL PROTECTED]
> Subject: [OT] auto convert resource property files
> to different language
> 
> 
> Hi,
> 
> I have a properties file which is in english, now  i
> have to create properties files for different
> langauage like russian, spanish, french etc. now i
> dont know any of these languages is there any
> automatic conversion tool which will translate the
> properties file to different languages.
> If it is a open source will be nice :-)
> 
> 
> Ashish
> 
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Splash Screen in Struts

2003-07-15 Thread Dhruva B. Reddy
I have an Action that could potentially take a long time to execute,
and would like to display a splash screen until the results of the
action are ready.

I went googling for this, but I can't seem to find a solution that
would fit within the Struts framework.  Has anyone done this before?

Thanks,
Dhruva

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: 2 iterators on one page problem

2003-07-15 Thread Mykola Ostapchuk
Thanks a lot! With km-nested-v2.03.jar it works fine.

Regards,
Mykola Ostapchuk


- Original Message - 
From: "Sri Sankaran" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Mykola
Ostapchuk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 3:14 PM
Subject: RE: 2 iterators on one page problem


Download the jar http://www.keyboardmonkey.com/downloads/km-nested-v2.03.jar
and add it to your classpath.  See if that does the trick.  This jar patches
some bugs with the nested classes included with Struts.

Sri

-Original Message-
From: Mykola Ostapchuk [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 2:58 PM
To: [EMAIL PROTECTED]
Subject: 2 iterators on one page problem

Hi,
I have a problem placing 2  with nested tags on one jsp.
When I put any of iterations below - they work fine. But when I put them
together, one after another, I receive an error:

org.apache.jasper.JasperException: No getter method for property projects of
bean projectsID

Strange, bean projectsID doesn't have 'projects' property at all...
Any suggestions?



1st  iteration


   

   
  


  



2nd  iteration


   

   
  
   





Regards,
Mykola Ostapchuk


-
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: mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Dichotomy
On Tue, 15 Jul 2003 12:34:07 -0600
Michael Muller <[EMAIL PROTECTED]> wrote:
> > 1) You can use mapping.getInputForward() - more straightforward.
> 
> so would you say cavaness's example broken?  is there any way to 
> configure struts such that it would work?

I'm not saying anything about Cavaness' book. I haven't read it so I cannot comment 
:-) I'm just saying you can get the Input forward easily this way.

> > 2) Yes, the forward can point to any resource, from a tiles definition to a jsp or 
> > an action url (I'm talking about the value you put in the  > name="myforward" path="?"/> bit).
> 
> but you can't stick in a forward, correct?  this is very confusing, that 
> you say forward= and then you can give it almost anything EXCEPT a 
> forward.  :(

Well the thing is that tag is *defining* a forward, so if you're trying to put another 
forward in the path= property then you're doing something wrong, cause if that other 
forward is accessible from this action, then you don't need to define it again!!

To clarify, in mapping.findForward() you can put the name of a forward that you 
defined in a  tag. The string that you pass to findForward() is the name 
property of the  tag.

In the  tag's path property, you can put:
- the path to a jsp page (eg "/pages/mypage.jsp")
- the action path to an action (eg "/do/myAction" or "/myAction.do")
- a tile definition if you defined them globally (eg "tiledef.admin.login" or 
"mytiledef") - see the Tiles doc for how to do that.

-- 
If education is too expensive, try ignorance.

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



RE: mapping.getInputForward returning null

2003-07-15 Thread Jerry Jalenak
Uh, no.  Damn, it's always the littlest things...   Thanks!

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


-Original Message-
From: Michael Muller [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 1:48 PM
To: Struts Users Mailing List
Subject: Re: mapping.getInputForward returning null



do you override the constructor and now call super()?

Jerry Jalenak wrote:

> For some reason when I am calling mapping.getInputForward() I'm getting a
> null value.
> 
> 
>  
> className="com.labone.membersolutions.struts.BaseActionMapping"
>   input="membersolutions.changepassword"
>   name="ChangePasswordBean"
>   path="/ChangePassword"
>   scope="request"
>   
>
type="com.labone.membersolutions.framework.web.action.ChangePasswordAction"
>   unknown="false"
>   validate="true">
>  property="secureAction"
>   value="false"/>
>  property="removeFormBean"
>   value="true"/>
>   
> 
> 
> My BaseActionMapping extends ActionMapping so I can include a couple of
> extra  statements (see above).  Everything seems to work OK
-
> my action is being called, the form bean is being instantiated, etc.  The
> first thing I do in my action is to set my default forward - 
> 
> 
>   public ActionForward executeAction(BaseActionMapping mapping,
> ActionForm form, HttpServletRequest request, HttpServletResponse response,
> ActionErrors errors)
>   {
>   System.out.println(">>> mapping.getInputForward is " +
> mapping.getInputForward());
>   ActionForward forward = (ActionForward)
> mapping.getInputForward();
>   
> 
> 
> The value I'm getting in forward is NULL.  Is there something I missed
when
> I extended ActionMapping?
> 
> TIA!
> 
> Jerry Jalenak
> Team Lead, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at the following email address:
[EMAIL PROTECTED]
> 
> 
> 
> -
> 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: 2 iterators on one page problem

2003-07-15 Thread Sri Sankaran
Download the jar http://www.keyboardmonkey.com/downloads/km-nested-v2.03.jar and add 
it to your classpath.  See if that does the trick.  This jar patches some bugs with 
the nested classes included with Struts.

Sri

-Original Message-
From: Mykola Ostapchuk [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 2:58 PM
To: [EMAIL PROTECTED]
Subject: 2 iterators on one page problem

Hi,
I have a problem placing 2  with nested tags on one jsp.
When I put any of iterations below - they work fine. But when I put them
together, one after another, I receive an error:

org.apache.jasper.JasperException: No getter method for property projects of
bean projectsID

Strange, bean projectsID doesn't have 'projects' property at all...
Any suggestions?



1st  iteration


   

   
  


  



2nd  iteration


   

   
  
   





Regards,
Mykola Ostapchuk


-
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: 2 iterators on one page problem

2003-07-15 Thread David Graham
--- Mykola Ostapchuk <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a problem placing 2  with nested tags on one
> jsp.
> When I put any of iterations below - they work fine. But when I put them
> together, one after another, I receive an error:
> 
> org.apache.jasper.JasperException: No getter method for property
> projects of
> bean projectsID
> 
> Strange, bean projectsID doesn't have 'projects' property at all...
> Any suggestions?

There are several open bugs against the nested tags so you may be running
into one of those.  Are you using a Servlet 2.3 container (ie. Tomcat
4.x)?  If so, you could use JSTL tags to write the page much more
concisely than the Struts tags.

David


> 
> 
> 
> 1st  iteration
> 
>  type="com.iprs.core.test.Project" indexId="i">
>
> 
> property="persons">
>   
> 
> 
>   
> 
> 
> 
> 2nd  iteration
> 
>  type="com.iprs.core.test.Person" indexId="i">
>
> 
> property="projects">
>   
>
> 
> 
> 
> 
> 
> Regards,
> Mykola Ostapchuk
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



2 iterators on one page problem

2003-07-15 Thread Mykola Ostapchuk
Hi,
I have a problem placing 2  with nested tags on one jsp.
When I put any of iterations below - they work fine. But when I put them
together, one after another, I receive an error:

org.apache.jasper.JasperException: No getter method for property projects of
bean projectsID

Strange, bean projectsID doesn't have 'projects' property at all...
Any suggestions?



1st  iteration


   

   
  


  



2nd  iteration


   

   
  
   





Regards,
Mykola Ostapchuk


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



Re: [OT]RE: Iterating the resultset contents in the view (jsp)

2003-07-15 Thread David Graham
--- Vijay Balakrishnan <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there a way to return this resultset from a SQL Query as an xml file
> using a beanutils class or Digester ?

I don't know of any class that does that.  Every application will require
its own XML format anyways.

David

> 
> Thanks,
> Vijay
> 
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 14, 2003 7:25 PM
> To: Struts Users Mailing List
> Subject: Re: Iterating the resultset contents in the view (jsp)
> 
> 
> 
> 
> On Mon, 14 Jul 2003, Richard Hill wrote:
> 
> > Date: Mon, 14 Jul 2003 16:36:17 -0700
> > From: Richard Hill <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: "'[EMAIL PROTECTED]'" 
> > <[EMAIL PROTECTED]>
> > Subject: Iterating the resultset contents in the view (jsp)
> >
> > Hi,
> > I'm working on an action that gets a resultset from a database table 
> > containing 4 columns. I need to pass that information back to the view
> 
> > (jsp) which will iterate over results. My question is what is the best
> 
> > way to do this. Do I create an array for each row in the resultset and
> 
> > insert each array in a collection, passing that back to the view?
> >
> 
> That is certainly one approach.  Indeed, commons-beanutils has a useful
> little class (org.apache.commons.beanutils.RowSetDynaClass) that is
> ideally
> suited to this use case.  It creates a List of DynaBeans representing
> the
> data content returned by the SELECT.  Because it makes a copy, you can
> close
> the result set (and return the connection back to the connection pool)
> before forwarding to the page.
> 
> > If so, how would you iterate over each array in the collection with 
> > the logic:iterate taglib? All of the examples only show iterations 
> > over single column lists.
> >
> 
> Let's assume you have done this in your Action:
> 
>   ResultSet rs = ...;
>   RowSetDynaClass rsdc = new RowSetDynaClass(rs);
>   rs.close();
>   request.setAttribute("customers", rsdc.getList());
> 
> so you now have a request attribute containing the list.  Now, in your
> page,
> you can say things like:
> 
>   
> Name is 
> Status is 
>   
> 
> and so on.  Details of RowSetDynaClass are in the javadocs for
> BeanUtils:
> 
>   http://jakarta.apache.org/commons/beanutils/
> 
> > Any help would be appreciated.
> >
> > Thanks,
> > Richard
> >
> 
> Craig
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: Java Script Confirm and struts

2003-07-15 Thread Raible, Matt
onclick="return confirm('Your message here')"

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 12:39 PM
To: [EMAIL PROTECTED]
Subject: Java Script Confirm and struts


Hi i wud like to have a confirm box that displays a message saying

" make sure all the values are correct, once it is submitted it cannot be
take back"

I want to have this when a user clicks a "continue" on a JSP page, if the
user clicks "yes" on the continue box it shud submit the form but if the
user
clicks "no" then the form shud not be submitted.I started writing it but i
donno what to

  

what do i need to write for the onclick for what i need to happen.


--Thanx in advance
   Mohan



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

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



RE: How do you access an application.properties value directly from within a class?

2003-07-15 Thread Raible, Matt
Or how about an ugly way? ;-)

<%@ page import="org.apache.struts.util.MessageResources,
 org.apache.struts.action.Action"%>

<% 
MessageResources resources = 
(MessageResources) request.getAttribute(Action.MESSAGES_KEY); 
%>

<%=resources.getMessage("userForm.userId")%>

Matt

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 12:04 PM
To: Struts Users Mailing List
Subject: Re: How do you access an application.properties value directly
from within a class?


You mean like this?


 




--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
678-910-8017
AIM:jmitchtx


- Original Message -
From: "Mike Deegan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 1:53 PM
Subject: Re: How do you access an application.properties value directly from
within a class?


> Hey Matt / All,
>
> Do you have an elegant way -  in scriptlet form - at the JSP level to grab
> an application.properties value to then use as a JSP expression (
<%=...%>)
> in the "value" attribute of a tag.
>
> I had tried to use the bean:message tag to get the "value" to populate
into
> the "value" attribute of another tag - that is when trying to combine two
> tags - but the page fails to compile. Can't remember the exact error msg
but
> it was along the lines of " = expected ..."
>
> I know you can use JSP expressions ( <%=...%>) in the "value" attribute of
> tags - but JSP compile fails when I try to use bean:message tag to
directly
> populate a tag's "value" attribute.
>
> So do you have an elegant way -  in scriptlet form - at the JSP level to
> grab an application.properties value to then use as a JSP expression (
> <%=...%>) in the "value" attribute of a tag.
>
> I searched for some time for an answer on this but got lost in the maze.
> Maybe the wording of my searches let me down.
>
> Or should I be attempting to do this in another way ... without scriptlets
> ... to get an application.properties value to populate into the "value"
> attribute of another tag.
>
> Any help appreciated ...
> Mike
>
> - Original Message -
> From: "Raible, Matt" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 15, 2003 10:53 AM
> Subject: RE: How do you access an application.properties value directly fr
> om within a class?
>
>
> > I forgot to add the simplest way in an Action class:
> >
> > MessageResources resources = getResources(request);
> >
> > resources.getMessage("keyName");
> >
> >
> > -Original Message-
> > From: Raible, Matt
> > Sent: Tuesday, July 15, 2003 10:51 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: How do you access an application.properties value directly
> > fr om within a class?
> >
> >
> > If you're just looking for the values, grab it as a resource bundle.
> Here's
> > how I grab it in a Business Delegate:
> >
> > // Get the application's messages resources
> > ResourceBundle resources =
> > ResourceBundle.getBundle("ApplicationResources");
> > String appDBVersion = resources.getString("webapp.db_version");
> >
> > And then of course, there's errors and messages - where it grabs it
> > automagically:
> >
> > errors.add(ActionErrors.GLOBAL_ERROR,
> >new ActionError("errors.existing.user",
> >userForm.getUsername(),
> >userForm.getEmail()));
> >
> > messages.add(ActionMessages.GLOBAL_MESSAGE,
> >  new ActionMessage("user.deleted",
> > userForm.getEmail()));
> >
> > And lastly, you can get it from the servlet context in a servlet outside
> of
> > struts:
> >
> > MessageResources resources =
> > ((MessageResources)
> > getServletContext().getAttribute(Globals.MESSAGES_KEY));
> >
> > resources.getMessage("userFormEx.username");
> >
> >
> > HTH,
> >
> > Matt
> >
> > -Original Message-
> > From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 15, 2003 10:28 AM
> > To: 'Struts Users Mailing List'
> > Subject: How do you access an application.properties value directly from
> > within a class?
> >
> >
> > When Struts load, it grabs application.properties and stores it's keys
and
> > values somewhere.  From within an action class I need to access a value
in
> > application.properties.  How could one do this?
> >
> > tia,
> > mark
> >
> >
> >
> > -
> > 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 additi

Re: mapping.getInputForward returning null

2003-07-15 Thread Michael Muller
do you override the constructor and now call super()?

Jerry Jalenak wrote:

For some reason when I am calling mapping.getInputForward() I'm getting a
null value.






My BaseActionMapping extends ActionMapping so I can include a couple of
extra  statements (see above).  Everything seems to work OK -
my action is being called, the form bean is being instantiated, etc.  The
first thing I do in my action is to set my default forward - 


public ActionForward executeAction(BaseActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse response,
ActionErrors errors)
{
System.out.println(">>> mapping.getInputForward is " +
mapping.getInputForward());
ActionForward forward = (ActionForward)
mapping.getInputForward();


The value I'm getting in forward is NULL.  Is there something I missed when
I extended ActionMapping?
TIA!

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
[EMAIL PROTECTED]

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



-
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: Where to build dropdown lists?

2003-07-15 Thread Erik Price


[EMAIL PROTECTED] wrote:
When using the client side validation, there is always a javascript pop up box that says something along the lines of 'Your a thick b*stard, fill in xxx!' Our client requirement is that we produce a list of errors at the top of the page, (the red  kinda thing), which rules out the use of these java script pop ups. 


You don't *have* to use popups.  You can always manipulate the document 
using the DOM to present a less obnoxious warning.

http://erikprice.com/clientvalidation.html



Erik

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


Re[2]: How do you access an application.properties value directly fr om within a class?

2003-07-15 Thread Martin Naskovski
Can you also somehow check from a JSP whether a certain message resource
key is set to a certain value and then render certain HTML based on that
value, or not? Thanks

Martin

Tuesday, July 15, 2003, 9:53:51 AM, you wrote:

RM> I forgot to add the simplest way in an Action class:

RM> MessageResources resources = getResources(request);

RM> resources.getMessage("keyName");


RM> -Original Message-
RM> From: Raible, Matt 
RM> Sent: Tuesday, July 15, 2003 10:51 AM
RM> To: 'Struts Users Mailing List'
RM> Subject: RE: How do you access an application.properties value directly
RM> fr om within a class?


RM> If you're just looking for the values, grab it as a resource bundle. Here's
RM> how I grab it in a Business Delegate:

RM> // Get the application's messages resources
RM> ResourceBundle resources =
RM> ResourceBundle.getBundle("ApplicationResources");
RM> String appDBVersion = resources.getString("webapp.db_version");

RM> And then of course, there's errors and messages - where it grabs it
RM> automagically:

RM> errors.add(ActionErrors.GLOBAL_ERROR,
RM>new ActionError("errors.existing.user",
RM>userForm.getUsername(),
RM>userForm.getEmail()));

RM> messages.add(ActionMessages.GLOBAL_MESSAGE,
RM>  new ActionMessage("user.deleted",
RM> userForm.getEmail()));

RM> And lastly, you can get it from the servlet context in a servlet outside of
RM> struts:

RM> MessageResources resources =
RM> ((MessageResources)
RM> getServletContext().getAttribute(Globals.MESSAGES_KEY));

RM> resources.getMessage("userFormEx.username");


RM> HTH,

RM> Matt


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



RE: Java Script Confirm and struts

2003-07-15 Thread Marcos Oliva
Mohan, 

You can use javascript


  function mymessage(){
alert("" make sure all the values are correct, once it is submitted
it cannot be take back"");
  }


on your 



I think that should do it,..

My two cents

Marcos 


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 11:39 AM
To: [EMAIL PROTECTED]
Subject: Java Script Confirm and struts

Hi i wud like to have a confirm box that displays a message saying

" make sure all the values are correct, once it is submitted it cannot
be
take back"

I want to have this when a user clicks a "continue" on a JSP page, if
the
user clicks "yes" on the continue box it shud submit the form but if the
user
clicks "no" then the form shud not be submitted.I started writing it but
i
donno what to

  

what do i need to write for the onclick for what i need to happen.


--Thanx in advance
   Mohan



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


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



RE: [OT] Java Script Confirm and struts

2003-07-15 Thread Jarnot Voytek Contr AU HQ/SC
http://www.google.com/search?q=javascript+confirm

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 1:39 PM
> To: [EMAIL PROTECTED]
> Subject: Java Script Confirm and struts
> 
> 
> Hi i wud like to have a confirm box that displays a message saying
> 
> " make sure all the values are correct, once it is submitted 
> it cannot be
> take back"
> 
> I want to have this when a user clicks a "continue" on a JSP 
> page, if the
> user clicks "yes" on the continue box it shud submit the form 
> but if the
> user
> clicks "no" then the form shud not be submitted.I started 
> writing it but i
> donno what to
> 
>   
> 
> what do i need to write for the onclick for what i need to happen.
> 
> 
> --Thanx in advance
>Mohan
> 
> 
> 
> -
> 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]



Java Script Confirm and struts

2003-07-15 Thread mohan
Hi i wud like to have a confirm box that displays a message saying

" make sure all the values are correct, once it is submitted it cannot be
take back"

I want to have this when a user clicks a "continue" on a JSP page, if the
user clicks "yes" on the continue box it shud submit the form but if the
user
clicks "no" then the form shud not be submitted.I started writing it but i
donno what to

  

what do i need to write for the onclick for what i need to happen.


--Thanx in advance
   Mohan



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



RE: [OT] auto convert resource property files to different langua ge

2003-07-15 Thread Kamholz, Keith (corp-staff) USX
I can't believe people actually ask for this kind of thing.  Completely
ridiculous.
It's hard to believe that someone fluent enough in computers to use struts
wouldn't have a grasp of the difficulty of language translation.


-Original Message-
From: Kearney, Michael [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 12:52 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] auto convert resource property files to different
langua ge


You've just asked for the Holy Grail of language translation.
I don't think that tool exists yet.  There are companies that
provide that service.

-Michael

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 10:21 AM
To: [EMAIL PROTECTED]
Subject: [OT] auto convert resource property files to different language


Hi,

I have a properties file which is in english, now  i
have to create properties files for different
langauage like russian, spanish, french etc. now i
dont know any of these languages is there any
automatic conversion tool which will translate the
properties file to different languages.
If it is a open source will be nice :-)


Ashish

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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

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

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



[OT]RE: Iterating the resultset contents in the view (jsp)

2003-07-15 Thread Vijay Balakrishnan
Hi,

Is there a way to return this resultset from a SQL Query as an xml file
using a beanutils class or Digester ?

Thanks,
Vijay

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 14, 2003 7:25 PM
To: Struts Users Mailing List
Subject: Re: Iterating the resultset contents in the view (jsp)




On Mon, 14 Jul 2003, Richard Hill wrote:

> Date: Mon, 14 Jul 2003 16:36:17 -0700
> From: Richard Hill <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" 
> <[EMAIL PROTECTED]>
> Subject: Iterating the resultset contents in the view (jsp)
>
> Hi,
> I'm working on an action that gets a resultset from a database table 
> containing 4 columns. I need to pass that information back to the view 
> (jsp) which will iterate over results. My question is what is the best 
> way to do this. Do I create an array for each row in the resultset and 
> insert each array in a collection, passing that back to the view?
>

That is certainly one approach.  Indeed, commons-beanutils has a useful
little class (org.apache.commons.beanutils.RowSetDynaClass) that is ideally
suited to this use case.  It creates a List of DynaBeans representing the
data content returned by the SELECT.  Because it makes a copy, you can close
the result set (and return the connection back to the connection pool)
before forwarding to the page.

> If so, how would you iterate over each array in the collection with 
> the logic:iterate taglib? All of the examples only show iterations 
> over single column lists.
>

Let's assume you have done this in your Action:

  ResultSet rs = ...;
  RowSetDynaClass rsdc = new RowSetDynaClass(rs);
  rs.close();
  request.setAttribute("customers", rsdc.getList());

so you now have a request attribute containing the list.  Now, in your page,
you can say things like:

  
Name is 
Status is 
  

and so on.  Details of RowSetDynaClass are in the javadocs for BeanUtils:

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

> Any help would be appreciated.
>
> Thanks,
> Richard
>

Craig

-
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: mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Michael Muller
1) You can use mapping.getInputForward() - more straightforward.
so would you say cavaness's example broken?  is there any way to 
configure struts such that it would work?

2) Yes, the forward can point to any resource, from a tiles definition to a jsp or an action url (I'm talking about the value you put in the  bit).
but you can't stick in a forward, correct?  this is very confusing, that 
you say forward= and then you can give it almost anything EXCEPT a 
forward.  :(

  -- mike



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


Re: how to get both values and text for option?

2003-07-15 Thread David Graham
Only the string in the value attribute gets submitted to the server so
there is no way of retrieving the text the user sees as the option.

David

--- "Jung, Eric (Contractor)" <[EMAIL PROTECTED]> wrote:
> Hi,
> I've searched the FAQ and the archives, but can't find an answer to this
> question. I'm know it's been asked before, but part of my problem seems
> to be that the mail-archive search tool doesn't like colons or < >
> characters (so searching for  becomes difficult). Try as I
> may, I'm not able to find an answer.
> 
> I'm trying to get both the values and the text of the selected
>  in an . It appears that right now I'm only
> getting one (the values, I think, but not the text) in my ActionForm's
> String array:
> 
>   public class MappingForm extends ActionForm {
> private String [] columns;
> //getColumns() and setColumns() removed for brevity
> ...
>   }
> 
> 
>   one
>   two
> 
> 
> In other words, I'm only getting "a" and "b" in my array. However, I'd
> like to have another String array, or a 2-dimensional String array, that
> receives both "a", "one", and "b", "two".
> 
> Any help would be greatly appreciated. Thanks in advance.
> 
> Sincerely,
> 
> Eric H. Jung
> Software Engineer
> Russell/Mellon Analytical Services
> 1-617-382-1373
> Everett, MA, USA
> [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



mapping.getInputForward returning null

2003-07-15 Thread Jerry Jalenak
For some reason when I am calling mapping.getInputForward() I'm getting a
null value.








My BaseActionMapping extends ActionMapping so I can include a couple of
extra  statements (see above).  Everything seems to work OK -
my action is being called, the form bean is being instantiated, etc.  The
first thing I do in my action is to set my default forward - 


public ActionForward executeAction(BaseActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse response,
ActionErrors errors)
{
System.out.println(">>> mapping.getInputForward is " +
mapping.getInputForward());
ActionForward forward = (ActionForward)
mapping.getInputForward();



The value I'm getting in forward is NULL.  Is there something I missed when
I extended ActionMapping?

TIA!

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


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



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



how to get both values and text for option?

2003-07-15 Thread Jung, Eric (Contractor)
Hi,
I've searched the FAQ and the archives, but can't find an answer to this question. I'm 
know it's been asked before, but part of my problem seems to be that the mail-archive 
search tool doesn't like colons or < > characters (so searching for  
becomes difficult). Try as I may, I'm not able to find an answer.

I'm trying to get both the values and the text of the selected  in an 
. It appears that right now I'm only getting one (the values, I think, 
but not the text) in my ActionForm's String array:

  public class MappingForm extends ActionForm {
private String [] columns;
//getColumns() and setColumns() removed for brevity
...
  }


  one
  two


In other words, I'm only getting "a" and "b" in my array. However, I'd like to have 
another String array, or a 2-dimensional String array, that receives both "a", "one", 
and "b", "two".

Any help would be greatly appreciated. Thanks in advance.

Sincerely,

Eric H. Jung
Software Engineer
Russell/Mellon Analytical Services
1-617-382-1373
Everett, MA, USA
[EMAIL PROTECTED]

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



RE: [Error Handlers] instanceof ?

2003-07-15 Thread Hookom, Jacob
That's what I thought from looking at the source, I'm working on a similar
bit for handling exceptions in my transaction framework, attached is the
current code I'm working on to handle parent/child/grandchild inheritance,
not fully tested.

Jacob

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 12:37 PM
To: Struts Users Mailing List
Subject: Re: [Error Handlers] instanceof ?

--- "Hookom, Jacob" <[EMAIL PROTECTED]> wrote:
> Off hand, would Struts be able to catch the exception with this desired
> handler?
>
> Action throws ServiceNotFoundException
> ExceptionHandler catches ServiceException
>
> Where ServiceNotFoundException is an instance of ServiceException?

Not currently.  I was thinking about improving the ExceptionHandler to
support that just today :-).  It would be nice if the ExceptionHandler
acted like a global try/catch block with the same inheritance rules.

David

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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

protected Map handledExceptions;
protected Collection unhandledExceptions;

public TaskKey findExceptionHandler(Class exceptionType)
{
TaskKey key = (TaskKey) this.handledExceptions.get(exceptionType);
if (key == null && !unhandledExceptions.contains(exceptionType))
{
synchronized (this.handledExceptions)
{
Class parent = null;
Class closestParent = null;
for (Iterator itr = this.handledExceptions.keySet().iterator();
itr.hasNext();
)
{
parent = (Class) itr.next();
if (parent.isAssignableFrom(exceptionType))
{
if (closestParent == null || 
closestParent.isAssignableFrom(parent))
{
closestParent = parent;
}
}
}

if (closestParent != null)
{
key = (TaskKey) 
this.handledExceptions.get(closestParent);
this.handledExceptions.put(exceptionType, key);
}
else
{
this.unhandledExceptions.add(exceptionType);
}

parent = null;
closestParent = null;
}
}
return key;
}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: How do you access an application.properties value directly from within a class?

2003-07-15 Thread Mike Deegan
Thanks Konstadinis and James !
Appreciate the help - had a mental block after a week long Stampede party
here in Calgary.

Mike

- Original Message - 
From: "Konstadinis Euaggelos" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, February 15, 2003 1:00 PM
Subject: Re: How do you access an application.properties value directly from
within a class?


> You can use this,
> 
>
> You can use the key as a scriplet   <% =key%>
>
>
> This solution works also in the following case ,
> if you want to display a title in your button if your write title =
> ""
> it willn 't work ,
>
> Following the above solution it works,
>
>  title="<%="["+key+"]"%>" >
>  key="button.previous"/>
> 
>
>
>
>
>
> - Original Message -
> From: "Mike Deegan" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 15, 2003 7:53 PM
> Subject: Re: How do you access an application.properties value directly
from
> within a class?
>
>
> > Hey Matt / All,
> >
> > Do you have an elegant way -  in scriptlet form - at the JSP level to
grab
> > an application.properties value to then use as a JSP expression (
> <%=...%>)
> > in the "value" attribute of a tag.
> >
> > I had tried to use the bean:message tag to get the "value" to populate
> into
> > the "value" attribute of another tag - that is when trying to combine
two
> > tags - but the page fails to compile. Can't remember the exact error msg
> but
> > it was along the lines of " = expected ..."
> >
> > I know you can use JSP expressions ( <%=...%>) in the "value" attribute
of
> > tags - but JSP compile fails when I try to use bean:message tag to
> directly
> > populate a tag's "value" attribute.
> >
> > So do you have an elegant way -  in scriptlet form - at the JSP level to
> > grab an application.properties value to then use as a JSP expression (
> > <%=...%>) in the "value" attribute of a tag.
> >
> > I searched for some time for an answer on this but got lost in the maze.
> > Maybe the wording of my searches let me down.
> >
> > Or should I be attempting to do this in another way ... without
scriptlets
> > ... to get an application.properties value to populate into the "value"
> > attribute of another tag.
> >
> > Any help appreciated ...
> > Mike
> >
> > - Original Message -
> > From: "Raible, Matt" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 15, 2003 10:53 AM
> > Subject: RE: How do you access an application.properties value directly
fr
> > om within a class?
> >
> >
> > > I forgot to add the simplest way in an Action class:
> > >
> > > MessageResources resources = getResources(request);
> > >
> > > resources.getMessage("keyName");
> > >
> > >
> > > -Original Message-
> > > From: Raible, Matt
> > > Sent: Tuesday, July 15, 2003 10:51 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: RE: How do you access an application.properties value
directly
> > > fr om within a class?
> > >
> > >
> > > If you're just looking for the values, grab it as a resource bundle.
> > Here's
> > > how I grab it in a Business Delegate:
> > >
> > > // Get the application's messages resources
> > > ResourceBundle resources =
> > > ResourceBundle.getBundle("ApplicationResources");
> > > String appDBVersion = resources.getString("webapp.db_version");
> > >
> > > And then of course, there's errors and messages - where it grabs it
> > > automagically:
> > >
> > > errors.add(ActionErrors.GLOBAL_ERROR,
> > >new ActionError("errors.existing.user",
> > >userForm.getUsername(),
> > >userForm.getEmail()));
> > >
> > > messages.add(ActionMessages.GLOBAL_MESSAGE,
> > >  new ActionMessage("user.deleted",
> > > userForm.getEmail()));
> > >
> > > And lastly, you can get it from the servlet context in a servlet
outside
> > of
> > > struts:
> > >
> > > MessageResources resources =
> > > ((MessageResources)
> > > getServletContext().getAttribute(Globals.MESSAGES_KEY));
> > >
> > > resources.getMessage("userFormEx.username");
> > >
> > >
> > > HTH,
> > >
> > > Matt
> > >
> > > -Original Message-
> > > From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, July 15, 2003 10:28 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: How do you access an application.properties value directly
from
> > > within a class?
> > >
> > >
> > > When Struts load, it grabs application.properties and stores it's keys
> and
> > > values somewhere.  From within an action class I need to access a
value
> in
> > > application.properties.  How could one do this?
> > >
> > > tia,
> > > mark
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >

Re: How do you access an application.properties value directly from within a class?

2003-07-15 Thread James Mitchell
You mean like this?


 




--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
678-910-8017
AIM:jmitchtx


- Original Message -
From: "Mike Deegan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 1:53 PM
Subject: Re: How do you access an application.properties value directly from
within a class?


> Hey Matt / All,
>
> Do you have an elegant way -  in scriptlet form - at the JSP level to grab
> an application.properties value to then use as a JSP expression (
<%=...%>)
> in the "value" attribute of a tag.
>
> I had tried to use the bean:message tag to get the "value" to populate
into
> the "value" attribute of another tag - that is when trying to combine two
> tags - but the page fails to compile. Can't remember the exact error msg
but
> it was along the lines of " = expected ..."
>
> I know you can use JSP expressions ( <%=...%>) in the "value" attribute of
> tags - but JSP compile fails when I try to use bean:message tag to
directly
> populate a tag's "value" attribute.
>
> So do you have an elegant way -  in scriptlet form - at the JSP level to
> grab an application.properties value to then use as a JSP expression (
> <%=...%>) in the "value" attribute of a tag.
>
> I searched for some time for an answer on this but got lost in the maze.
> Maybe the wording of my searches let me down.
>
> Or should I be attempting to do this in another way ... without scriptlets
> ... to get an application.properties value to populate into the "value"
> attribute of another tag.
>
> Any help appreciated ...
> Mike
>
> - Original Message -
> From: "Raible, Matt" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 15, 2003 10:53 AM
> Subject: RE: How do you access an application.properties value directly fr
> om within a class?
>
>
> > I forgot to add the simplest way in an Action class:
> >
> > MessageResources resources = getResources(request);
> >
> > resources.getMessage("keyName");
> >
> >
> > -Original Message-
> > From: Raible, Matt
> > Sent: Tuesday, July 15, 2003 10:51 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: How do you access an application.properties value directly
> > fr om within a class?
> >
> >
> > If you're just looking for the values, grab it as a resource bundle.
> Here's
> > how I grab it in a Business Delegate:
> >
> > // Get the application's messages resources
> > ResourceBundle resources =
> > ResourceBundle.getBundle("ApplicationResources");
> > String appDBVersion = resources.getString("webapp.db_version");
> >
> > And then of course, there's errors and messages - where it grabs it
> > automagically:
> >
> > errors.add(ActionErrors.GLOBAL_ERROR,
> >new ActionError("errors.existing.user",
> >userForm.getUsername(),
> >userForm.getEmail()));
> >
> > messages.add(ActionMessages.GLOBAL_MESSAGE,
> >  new ActionMessage("user.deleted",
> > userForm.getEmail()));
> >
> > And lastly, you can get it from the servlet context in a servlet outside
> of
> > struts:
> >
> > MessageResources resources =
> > ((MessageResources)
> > getServletContext().getAttribute(Globals.MESSAGES_KEY));
> >
> > resources.getMessage("userFormEx.username");
> >
> >
> > HTH,
> >
> > Matt
> >
> > -Original Message-
> > From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 15, 2003 10:28 AM
> > To: 'Struts Users Mailing List'
> > Subject: How do you access an application.properties value directly from
> > within a class?
> >
> >
> > When Struts load, it grabs application.properties and stores it's keys
and
> > values somewhere.  From within an action class I need to access a value
in
> > application.properties.  How could one do this?
> >
> > tia,
> > mark
> >
> >
> >
> > -
> > 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: How do you access an application.properties value directly from within a class?

2003-07-15 Thread Konstadinis Euaggelos
You can use this,


You can use the key as a scriplet   <% =key%>


This solution works also in the following case ,
if you want to display a title in your button if your write title =
""
it willn 't work ,

Following the above solution it works,

" >







- Original Message -
From: "Mike Deegan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 7:53 PM
Subject: Re: How do you access an application.properties value directly from
within a class?


> Hey Matt / All,
>
> Do you have an elegant way -  in scriptlet form - at the JSP level to grab
> an application.properties value to then use as a JSP expression (
<%=...%>)
> in the "value" attribute of a tag.
>
> I had tried to use the bean:message tag to get the "value" to populate
into
> the "value" attribute of another tag - that is when trying to combine two
> tags - but the page fails to compile. Can't remember the exact error msg
but
> it was along the lines of " = expected ..."
>
> I know you can use JSP expressions ( <%=...%>) in the "value" attribute of
> tags - but JSP compile fails when I try to use bean:message tag to
directly
> populate a tag's "value" attribute.
>
> So do you have an elegant way -  in scriptlet form - at the JSP level to
> grab an application.properties value to then use as a JSP expression (
> <%=...%>) in the "value" attribute of a tag.
>
> I searched for some time for an answer on this but got lost in the maze.
> Maybe the wording of my searches let me down.
>
> Or should I be attempting to do this in another way ... without scriptlets
> ... to get an application.properties value to populate into the "value"
> attribute of another tag.
>
> Any help appreciated ...
> Mike
>
> - Original Message -
> From: "Raible, Matt" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 15, 2003 10:53 AM
> Subject: RE: How do you access an application.properties value directly fr
> om within a class?
>
>
> > I forgot to add the simplest way in an Action class:
> >
> > MessageResources resources = getResources(request);
> >
> > resources.getMessage("keyName");
> >
> >
> > -Original Message-
> > From: Raible, Matt
> > Sent: Tuesday, July 15, 2003 10:51 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: How do you access an application.properties value directly
> > fr om within a class?
> >
> >
> > If you're just looking for the values, grab it as a resource bundle.
> Here's
> > how I grab it in a Business Delegate:
> >
> > // Get the application's messages resources
> > ResourceBundle resources =
> > ResourceBundle.getBundle("ApplicationResources");
> > String appDBVersion = resources.getString("webapp.db_version");
> >
> > And then of course, there's errors and messages - where it grabs it
> > automagically:
> >
> > errors.add(ActionErrors.GLOBAL_ERROR,
> >new ActionError("errors.existing.user",
> >userForm.getUsername(),
> >userForm.getEmail()));
> >
> > messages.add(ActionMessages.GLOBAL_MESSAGE,
> >  new ActionMessage("user.deleted",
> > userForm.getEmail()));
> >
> > And lastly, you can get it from the servlet context in a servlet outside
> of
> > struts:
> >
> > MessageResources resources =
> > ((MessageResources)
> > getServletContext().getAttribute(Globals.MESSAGES_KEY));
> >
> > resources.getMessage("userFormEx.username");
> >
> >
> > HTH,
> >
> > Matt
> >
> > -Original Message-
> > From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 15, 2003 10:28 AM
> > To: 'Struts Users Mailing List'
> > Subject: How do you access an application.properties value directly from
> > within a class?
> >
> >
> > When Struts load, it grabs application.properties and stores it's keys
and
> > values somewhere.  From within an action class I need to access a value
in
> > application.properties.  How could one do this?
> >
> > tia,
> > mark
> >
> >
> >
> > -
> > 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]



link tags and nesting

2003-07-15 Thread Michael Ruppin
Is there a way to accomplish something resembling this
without scriptlet?:




The jsp rendering this is using a nested indexed
ActionForm, and the action mapped via Foo.do uses the
same nested indexed ActionForm.  I'm using the nested
taglib, but it doesn't appear as if there's a way to
automate the "paramId" like one would the "name" for a
tag rendering some  HTML.

m

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Is this really the best way to handle this problem

2003-07-15 Thread Brown, Melonie S. - Contractor

*sigh*  I meant to include the following code snippet before hitting send,
but Outlook had other ideas


  


   

 

-Original Message-
From: Brown, Melonie S. - Contractor 
Sent: Tuesday, July 15, 2003 1:52 PM
To: '[EMAIL PROTECTED]'
Subject: Is this really the best way to handle this problem


If you have your properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean, you need to set the
values of the individual items in the list.  The following works for me (but
I had to make the form session scoped instead of request to make it work)


See http://jakarta.apache.org/struts/faqs/indexedprops.html




 Original Message 
Subject: Is this really the best way to handle this problem
Date: Tue, 15 Jul 2003 19:28:26 +0200
From: Linus Nikander <[EMAIL PROTECTED]>
Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
Organization: baseBeans Engineering
Newsgroups: gmane.comp.jakarta.struts.user

I've been struggling with a problem similar to the one described (and
solved) at
http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html .
Is this really the recommended way to solve population / repopulation of
properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way to
acheive the same result ? (I.e represent a collection in a form)

I've read that a practice often used to represent collections (a DB-table
for intstance) is to make a bean that has getters / setters for the
properties of a single row and then have the ActionForm contain a List() of
those beans. One for every row  (in the DB-example). That far I can follow,
and see how / why. But is there no better way to update the values in the
ActionForm (beans) when the data is submitted than in the URL above ?

//Linus Nikander - [EMAIL PROTECTED]

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



checkboxes - ActionForm in session scope

2003-07-15 Thread Khalid K.
Hello All,

I have the following problem, and any help is greatly appreciated:

1. html form that has a checkbox which is associated with a Action Form
Bean - boolean attribute
2. ActionForm is in session scope
3. I call reset method selectively since I am trying to develope wizard
style pages with one form.
4. using struts 1.0.2

problem:

  When I check a checkbox and submit the form, on the "pending" page, I see
the value as set to "true" which is OK.

Now, When I click on "modify" which takes me to the html with the form, and
I uncheck the checkbox and submit againthe value on the "pending" page
is still set to TRUE. Which it should be set to FALSE.  any ideas ??

Khalid
- Original Message -
From: "John M. Corro" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 10:48 AM
Subject: Re: Is this really the best way to handle this problem


> I've seen two ways of dealing w/ this problem, both of which I see as
'hackish'
> in nature.
>
> Solution A:
>
> In your getters/setters you implement the following code
>
> public MyCustomBean getMyCustomBean(int index) {
>while(index >= myCustomBeanList.size()) {
>   myCustomBeanList.add(new MyCustomBean());
>}
>return (MyCustomBean)myCustomBeanList.get(index);
> }
>
> In that way you'll never encounter the common IndexOutOfBoundsException.
The
> problem here is that you tend to use alot of hidden fields in your UI to
repopulate
> the data back into the dynamically created beans.
>
> Solution B:
>
> In your reset() method you repopulate your internal Collection of beans.
The
> problem w/ this approach is that often times you have a separate Action
that
> prepopulates your ActionForm.  This provides for good separation - the
Action
> is a retriever of a data (nothing more) and the ActionForm is merely a
container
> for data (nothing more).  With this approach your ActionForm suddenly
starts
> becoming more intelligent than it really should be.  Now it's aware of how
to
> populate itself...not a good thing IMO.
>
> I'd be very interested in hearing other solutions to this problem as I
find
> both of the above solutions cumbersome and hackish and would love to stop
implementing
> them.
>
> >I've been struggling with a problem similar to the one described (and
> >solved) at
> >http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html
.
>
> >Is this really the recommended way to solve population / repopulation of
> >properties stored in a List() of
> >whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way
to
>
> >acheive the same result ? (I.e represent a collection in a form)
> >
> >I've read that a practice often used to represent collections (a DB-table
> >for intstance) is to make a bean that has getters / setters for the
> >properties of a single row and then have the ActionForm contain a List()
of
>
> >those beans. One for every row  (in the DB-example). That far I can
follow,
>
> >and see how / why. But is there no better way to update the values in the
> >ActionForm (beans) when the data is submitted than in the URL above ?
> >
> >//Linus Nikander - [EMAIL PROTECTED]
> >
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> John M. Corro
> Cornerstone Consulting
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


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



Re: How do you access an application.properties value directly from within a class?

2003-07-15 Thread Mike Deegan
Hey Matt / All,

Do you have an elegant way -  in scriptlet form - at the JSP level to grab
an application.properties value to then use as a JSP expression ( <%=...%>)
in the "value" attribute of a tag.

I had tried to use the bean:message tag to get the "value" to populate into
the "value" attribute of another tag - that is when trying to combine two
tags - but the page fails to compile. Can't remember the exact error msg but
it was along the lines of " = expected ..."

I know you can use JSP expressions ( <%=...%>) in the "value" attribute of
tags - but JSP compile fails when I try to use bean:message tag to directly
populate a tag's "value" attribute.

So do you have an elegant way -  in scriptlet form - at the JSP level to
grab an application.properties value to then use as a JSP expression (
<%=...%>) in the "value" attribute of a tag.

I searched for some time for an answer on this but got lost in the maze.
Maybe the wording of my searches let me down.

Or should I be attempting to do this in another way ... without scriptlets
... to get an application.properties value to populate into the "value"
attribute of another tag.

Any help appreciated ...
Mike

- Original Message - 
From: "Raible, Matt" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 10:53 AM
Subject: RE: How do you access an application.properties value directly fr
om within a class?


> I forgot to add the simplest way in an Action class:
>
> MessageResources resources = getResources(request);
>
> resources.getMessage("keyName");
>
>
> -Original Message-
> From: Raible, Matt
> Sent: Tuesday, July 15, 2003 10:51 AM
> To: 'Struts Users Mailing List'
> Subject: RE: How do you access an application.properties value directly
> fr om within a class?
>
>
> If you're just looking for the values, grab it as a resource bundle.
Here's
> how I grab it in a Business Delegate:
>
> // Get the application's messages resources
> ResourceBundle resources =
> ResourceBundle.getBundle("ApplicationResources");
> String appDBVersion = resources.getString("webapp.db_version");
>
> And then of course, there's errors and messages - where it grabs it
> automagically:
>
> errors.add(ActionErrors.GLOBAL_ERROR,
>new ActionError("errors.existing.user",
>userForm.getUsername(),
>userForm.getEmail()));
>
> messages.add(ActionMessages.GLOBAL_MESSAGE,
>  new ActionMessage("user.deleted",
> userForm.getEmail()));
>
> And lastly, you can get it from the servlet context in a servlet outside
of
> struts:
>
> MessageResources resources =
> ((MessageResources)
> getServletContext().getAttribute(Globals.MESSAGES_KEY));
>
> resources.getMessage("userFormEx.username");
>
>
> HTH,
>
> Matt
>
> -Original Message-
> From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 10:28 AM
> To: 'Struts Users Mailing List'
> Subject: How do you access an application.properties value directly from
> within a class?
>
>
> When Struts load, it grabs application.properties and stores it's keys and
> values somewhere.  From within an action class I need to access a value in
> application.properties.  How could one do this?
>
> tia,
> mark
>
>
>
> -
> 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: mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Dichotomy
Mike,

1) You can use mapping.getInputForward() - more straightforward.

2) Yes, the forward can point to any resource, from a tiles definition to a jsp or an 
action url (I'm talking about the value you put in the  bit).

-- 
If education is too expensive, try ignorance.

On Tue, 15 Jul 2003 11:41:30 -0600
Michael Muller <[EMAIL PROTECTED]> wrote:

> 
> In Cavaness's book "Programming Jakarta Struts", there is a code sample
> on page 188 that contains a line I don't understand.
> 
> In the "execute" method of an implementation of an "Action" class, is
> the following line of code:
> 
> return mapping.findForward( mapping.getInput() );
> 
> Doesn't the input have to be an Action?  The DTD says "action or other
> resource".  What other resource?  Could I put the name of a tile in
> there?  I tried putting the name of a forward in there, but the
> validation framework complained that it didn't start with a "/".
> 
> Thanks,
> 
>-- Mike
> 
> 
> 
> 
> 
> 
> 
> -
> 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]



Is this really the best way to handle this problem

2003-07-15 Thread Brown, Melonie S. - Contractor
If you have your properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean, you need to set the
values of the individual items in the list.  The following works for me (but
I had to make the form session scoped instead of request to make it work)


See http://jakarta.apache.org/struts/faqs/indexedprops.html




 Original Message 
Subject: Is this really the best way to handle this problem
Date: Tue, 15 Jul 2003 19:28:26 +0200
From: Linus Nikander <[EMAIL PROTECTED]>
Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
Organization: baseBeans Engineering
Newsgroups: gmane.comp.jakarta.struts.user

I've been struggling with a problem similar to the one described (and
solved) at
http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html .
Is this really the recommended way to solve population / repopulation of
properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way to
acheive the same result ? (I.e represent a collection in a form)

I've read that a practice often used to represent collections (a DB-table
for intstance) is to make a bean that has getters / setters for the
properties of a single row and then have the ActionForm contain a List() of
those beans. One for every row  (in the DB-example). That far I can follow,
and see how / why. But is there no better way to update the values in the
ActionForm (beans) when the data is submitted than in the URL above ?

//Linus Nikander - [EMAIL PROTECTED]

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



Re: A dynamic _map_ (not list) index?

2003-07-15 Thread Martin Naskovski
Never mind this question, I answered it to myself. The EL works just as
well on map backed forms as it does on list-backed forms, or list backed
form properties, more correctly :).

Sorry to bug anyone.
Martin

Tuesday, July 15, 2003, 9:34:16 AM, you wrote:

MN> I was looking at http://jakarta.apache.org/struts/faqs/indexedprops.html,
MN> and realized it's possible to get a dynamic arraylist index by using
MN> Struts-EL.  Well, my question is, if I have a radio button like:

MN> 
MN> 
MN> 


MN> Can I _still_ use Struts-EL inside the value="" attribute to generate a
MN> dynamic key based off some exposed iterator (e.g. "element" from above),
MN> which is indeed a String value?

MN> What's a way to do this? It isn't quite the same as an index for a list,
MN> it's not a number, and there's no concrete example for a dynamic map index,
MN> which is why I ask.

MN> Can someone clue me in? I'm sort of stuck :).

MN> Thank you.
MN> Martin


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


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



Re: Is this really the best way to handle this problem

2003-07-15 Thread John M. Corro
I've seen two ways of dealing w/ this problem, both of which I see as 'hackish'
in nature.

Solution A:

In your getters/setters you implement the following code

public MyCustomBean getMyCustomBean(int index) {
   while(index >= myCustomBeanList.size()) {
  myCustomBeanList.add(new MyCustomBean());
   }
   return (MyCustomBean)myCustomBeanList.get(index);
}

In that way you'll never encounter the common IndexOutOfBoundsException.  The
problem here is that you tend to use alot of hidden fields in your UI to repopulate
the data back into the dynamically created beans.

Solution B:

In your reset() method you repopulate your internal Collection of beans.  The
problem w/ this approach is that often times you have a separate Action that
prepopulates your ActionForm.  This provides for good separation - the Action
is a retriever of a data (nothing more) and the ActionForm is merely a container
for data (nothing more).  With this approach your ActionForm suddenly starts
becoming more intelligent than it really should be.  Now it's aware of how to
populate itself...not a good thing IMO.

I'd be very interested in hearing other solutions to this problem as I find
both of the above solutions cumbersome and hackish and would love to stop implementing
them.

>I've been struggling with a problem similar to the one described (and
>solved) at
>http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html .

>Is this really the recommended way to solve population / repopulation of
>properties stored in a List() of
>whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way to

>acheive the same result ? (I.e represent a collection in a form)
>
>I've read that a practice often used to represent collections (a DB-table
>for intstance) is to make a bean that has getters / setters for the
>properties of a single row and then have the ActionForm contain a List() of

>those beans. One for every row  (in the DB-example). That far I can follow,

>and see how / why. But is there no better way to update the values in the
>ActionForm (beans) when the data is submitted than in the URL above ?
>
>//Linus Nikander - [EMAIL PROTECTED]
>
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>



John M. Corro
Cornerstone Consulting

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



RE: [ARTICLE] Succeeding with Struts Pt 2: Indexed Properties of Beans

2003-07-15 Thread James Turner
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
> 
> The iterated object has "key" and "value" properties to give 
> you access to either the key or the value with a nested expression.
> 

Right, but there's no way to use them with the indexed="true" flag of
the html tags.  You still end up having to do some convoluted field name
generation using EL or <%=.

James



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



mapping.findForward( mapping.getInput() ) ?

2003-07-15 Thread Michael Muller
In Cavaness's book "Programming Jakarta Struts", there is a code sample
on page 188 that contains a line I don't understand.
In the "execute" method of an implementation of an "Action" class, is
the following line of code:
return mapping.findForward( mapping.getInput() );

Doesn't the input have to be an Action?  The DTD says "action or other
resource".  What other resource?  Could I put the name of a tile in
there?  I tried putting the name of a forward in there, but the
validation framework complained that it didn't start with a "/".
Thanks,

  -- Mike







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


RE: reusing same form for inserts and updates

2003-07-15 Thread Mark Galbreath
My primary keys are the email addresses of the users, and I always bring up
a blank form and allow the user to choose (radio buttons) to retrieve,
update, or submit new records based on date.  The userId is stored in
session scope at login.

Mark

-Original Message-
From: Wes Rood [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 1:13 PM
To: Struts Users Mailing List
Subject: reusing same form for inserts and updates


I've searched the archives for this type of discussion but I'm not 
really finding what I want.

I'd like to reuse the same jsp form for both inserts and updates of a 
particular set of data.  My current solution is to come into the action 
with a flag of "new" or "edit".  If "edit", the action will fetch the 
existing data into the FormBean by the primary key (int) which is 
currently in the FormBean, then forward to the input view.  If "new", 
the action will just forward to the input view (thus the primary key is 0)

The input view is the jsp form, which has a hidden property set to the 
primary key of the FormBean.

The form is then submitted back to this action with a flag of "save", 
and then it will check for the presence of the primary key (from the 
hidden field), and do an insert or update based on whether or not it is > 0.

Another variation of this is to set a specific field in the FormBean 
instead of the primary key, but it is the same idea (still requires 
handling this field as a hidden field in the form)  Which I found at:
http://www.reumann.net/do/struts/lessons

I'd really like to clean this up a bit, hopefully by removing the 
requirement of setting a hidden property in the form.  One idea was to 
put the new/edit information into the session, but this fails if the 
user has 2 browser windows open, trying to do a new record in one window 
and an update in another (since they share the session).  Another idea 
was to attempt an update, and then fail back to an insert, or vice 
versa.  But that is an extra db hit.

Any suggestions or experiences would be helpful.  Thanks!




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




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



Re: [Error Handlers] instanceof ?

2003-07-15 Thread David Graham
--- "Hookom, Jacob" <[EMAIL PROTECTED]> wrote:
> Off hand, would Struts be able to catch the exception with this desired
> handler?
> 
> Action throws ServiceNotFoundException
> ExceptionHandler catches ServiceException
> 
> Where ServiceNotFoundException is an instance of ServiceException?

Not currently.  I was thinking about improving the ExceptionHandler to
support that just today :-).  It would be nice if the ExceptionHandler
acted like a global try/catch block with the same inheritance rules.

David

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: Iterating the resultset contents in the view (jsp)

2003-07-15 Thread David Graham
--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> 
> 
> On Tue, 15 Jul 2003, Kris Schneider wrote:
> 
> > Date: Tue, 15 Jul 2003 12:42:36 -0400
> > From: Kris Schneider <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: Re: Iterating the resultset contents in the view (jsp)
> >
> > Sure, understood. In fact I do this myself. But the reality is it's
> still an
> > identifier that's defined in the data layer, in this case embedded in
> SQL.
> 
> Isn't that going to be true even if you bury SQL inside a DAO?  Someone
> somewhere is going to have to deal with the column names that are
> defined
> in your database.
> 
> > My point was that I'd be more concerned with identifiers defined in
> the
> > data layer getting referenced in the view layer then I would with
> using
> > Result and ResultSupport outside of a web app.
> 
> A lot of people externalize SQL command strings into properties files so
> that they can tweak them for differences between databases.  This would
> also give you a level of separation, in that you can reference the
> actual
> column names ONLY in the properties file strigns, and have your code
> using
> the result set deal only with the aliases set with "as".

I've found this approach to be quite useful.  It gets tough when you need
to dynamically create a query based on a user's search form values.  In
that situation I define each SQL search chunk under it's own key and use
MessageFormat to insert values appropriately.

David

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Is this really the best way to handle this problem

2003-07-15 Thread Linus Nikander
I've been struggling with a problem similar to the one described (and
solved) at
http://www.mail-archive.com/[EMAIL PROTECTED]/msg50901.html .
Is this really the recommended way to solve population / repopulation of
properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way to
acheive the same result ? (I.e represent a collection in a form)

I've read that a practice often used to represent collections (a DB-table
for intstance) is to make a bean that has getters / setters for the
properties of a single row and then have the ActionForm contain a List() of
those beans. One for every row  (in the DB-example). That far I can follow,
and see how / why. But is there no better way to update the values in the
ActionForm (beans) when the data is submitted than in the URL above ?

//Linus Nikander - [EMAIL PROTECTED]




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



Re: reusing same form for inserts and updates

2003-07-15 Thread Wes Rood
Woops... after thinking about this more, I realized that I *have* to put 
the primary key in the form somewhere, or I won't know what record to 
update... I'd still like to hear your experiences in this area though... 
Thanks

Wes Rood wrote:

I've searched the archives for this type of discussion but I'm not 
really finding what I want.

I'd like to reuse the same jsp form for both inserts and updates of a 
particular set of data.  My current solution is to come into the 
action with a flag of "new" or "edit".  If "edit", the action will 
fetch the existing data into the FormBean by the primary key (int) 
which is currently in the FormBean, then forward to the input view.  
If "new", the action will just forward to the input view (thus the 
primary key is 0)

The input view is the jsp form, which has a hidden property set to the 
primary key of the FormBean.

The form is then submitted back to this action with a flag of "save", 
and then it will check for the presence of the primary key (from the 
hidden field), and do an insert or update based on whether or not it 
is > 0.

Another variation of this is to set a specific field in the FormBean 
instead of the primary key, but it is the same idea (still requires 
handling this field as a hidden field in the form)  Which I found at:
http://www.reumann.net/do/struts/lessons

I'd really like to clean this up a bit, hopefully by removing the 
requirement of setting a hidden property in the form.  One idea was to 
put the new/edit information into the session, but this fails if the 
user has 2 browser windows open, trying to do a new record in one 
window and an update in another (since they share the session).  
Another idea was to attempt an update, and then fail back to an 
insert, or vice versa.  But that is an extra db hit.

Any suggestions or experiences would be helpful.  Thanks!



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



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


Re: Iterating the resultset contents in the view (jsp)

2003-07-15 Thread Craig R. McClanahan


On Tue, 15 Jul 2003, Kris Schneider wrote:

> Date: Tue, 15 Jul 2003 12:42:36 -0400
> From: Kris Schneider <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Iterating the resultset contents in the view (jsp)
>
> Sure, understood. In fact I do this myself. But the reality is it's still an
> identifier that's defined in the data layer, in this case embedded in SQL.

Isn't that going to be true even if you bury SQL inside a DAO?  Someone
somewhere is going to have to deal with the column names that are defined
in your database.

> My point was that I'd be more concerned with identifiers defined in the
> data layer getting referenced in the view layer then I would with using
> Result and ResultSupport outside of a web app.

A lot of people externalize SQL command strings into properties files so
that they can tweak them for differences between databases.  This would
also give you a level of separation, in that you can reference the actual
column names ONLY in the properties file strigns, and have your code using
the result set deal only with the aliases set with "as".

Craig

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



[Error Handlers] instanceof ?

2003-07-15 Thread Hookom, Jacob
Off hand, would Struts be able to catch the exception with this desired
handler?

Action throws ServiceNotFoundException
ExceptionHandler catches ServiceException

Where ServiceNotFoundException is an instance of ServiceException?

Thanks,
Jacob

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



RE: URL validation with struts???

2003-07-15 Thread Gandle, Panchasheel
Thats true, so if you have https, we could always truncate the 's' after
http
and pass it to URL to check whether it throws MalformedURLException.

should work.


Panchasheel



-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 1:12 PM
To: Struts Users Mailing List
Subject: RE: URL validation with struts???




On Tue, 15 Jul 2003, Gandle, Panchasheel wrote:

> That shoud do it right
> Open a new URL with a specified URL, if it throws MalformedURLException
> its bad URL

Unfortunately, there's a gotcha to this approach -- the JVM you are
running on has to understand the scheme part of the URL you are testing
for.  For example, you'll get a MalformedURLException on any "https:" URL
(even if it's actually correct) if your JVM doesn't have the JSSE classes
(or equivalent) that understands SSH.

Craig

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

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



RE: How do you access an application.properties value directly fr om within a class?

2003-07-15 Thread Mark Galbreath
Nice, clean, elegant solution - thanks a lot, Matt!

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 12:54 PM
To: 'Struts Users Mailing List'
Subject: RE: How do you access an application.properties value directly fr
om within a class?


I forgot to add the simplest way in an Action class:

MessageResources resources = getResources(request);

resources.getMessage("keyName");


-Original Message-
From: Raible, Matt 
Sent: Tuesday, July 15, 2003 10:51 AM
To: 'Struts Users Mailing List'
Subject: RE: How do you access an application.properties value directly fr
om within a class?


If you're just looking for the values, grab it as a resource bundle. Here's
how I grab it in a Business Delegate:

// Get the application's messages resources
ResourceBundle resources =
ResourceBundle.getBundle("ApplicationResources");
String appDBVersion = resources.getString("webapp.db_version");

And then of course, there's errors and messages - where it grabs it
automagically:

errors.add(ActionErrors.GLOBAL_ERROR,
   new ActionError("errors.existing.user",
   userForm.getUsername(),
   userForm.getEmail()));

messages.add(ActionMessages.GLOBAL_MESSAGE,
 new ActionMessage("user.deleted",
userForm.getEmail()));

And lastly, you can get it from the servlet context in a servlet outside of
struts:

MessageResources resources =
((MessageResources)
getServletContext().getAttribute(Globals.MESSAGES_KEY));

resources.getMessage("userFormEx.username");


HTH,

Matt

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: How do you access an application.properties value directly from
within a class?


When Struts load, it grabs application.properties and stores it's keys and
values somewhere.  From within an action class I need to access a value in
application.properties.  How could one do this?

tia,
mark



-
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: URL validation with struts???

2003-07-15 Thread Craig R. McClanahan


On Tue, 15 Jul 2003, Gandle, Panchasheel wrote:

> That shoud do it right
> Open a new URL with a specified URL, if it throws MalformedURLException
> its bad URL

Unfortunately, there's a gotcha to this approach -- the JVM you are
running on has to understand the scheme part of the URL you are testing
for.  For example, you'll get a MalformedURLException on any "https:" URL
(even if it's actually correct) if your JVM doesn't have the JSSE classes
(or equivalent) that understands SSH.

Craig

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



reusing same form for inserts and updates

2003-07-15 Thread Wes Rood
I've searched the archives for this type of discussion but I'm not 
really finding what I want.

I'd like to reuse the same jsp form for both inserts and updates of a 
particular set of data.  My current solution is to come into the action 
with a flag of "new" or "edit".  If "edit", the action will fetch the 
existing data into the FormBean by the primary key (int) which is 
currently in the FormBean, then forward to the input view.  If "new", 
the action will just forward to the input view (thus the primary key is 0)

The input view is the jsp form, which has a hidden property set to the 
primary key of the FormBean.

The form is then submitted back to this action with a flag of "save", 
and then it will check for the presence of the primary key (from the 
hidden field), and do an insert or update based on whether or not it is > 0.

Another variation of this is to set a specific field in the FormBean 
instead of the primary key, but it is the same idea (still requires 
handling this field as a hidden field in the form)  Which I found at:
http://www.reumann.net/do/struts/lessons

I'd really like to clean this up a bit, hopefully by removing the 
requirement of setting a hidden property in the form.  One idea was to 
put the new/edit information into the session, but this fails if the 
user has 2 browser windows open, trying to do a new record in one window 
and an update in another (since they share the session).  Another idea 
was to attempt an update, and then fail back to an insert, or vice 
versa.  But that is an extra db hit.

Any suggestions or experiences would be helpful.  Thanks!



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


RE: Extending RequestProcessor with Tiles

2003-07-15 Thread Jarnot Voytek Contr AU HQ/SC
extend org.apache.struts.tiles.TilesRequestProcessor

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


> -Original Message-
> From: Pat Quinn [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 12:08 PM
> To: [EMAIL PROTECTED]
> Subject: Extending RequestProcessor with Tiles
> 
> 
> I have extended the org.apache.struts.action.RequestProcessor (i.e. 
> processPreprocess() method) then i continued to implement tiles i.e. 
> defining the plugin in my struts-config.xml.
> 
> 
> Now on startup i get the following error:
> 
> TilesPlugin : Specified RequestProcessor not compatible with 
> TilesRequestProcessor; - nested throwable: 
> (javax.servlet.ServletException: 
> TilesPlugin : Specified RequestProcessor not compatible with 
> TilesRequestProcessor)
>   at org.jboss.jetty.Jetty.deploy(Jetty.java:436)
>   at 
> org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
> 
> 
> I've also upgraded to struts 1.1 and still get the same error
> 
> 
> any ideas???
> 
> _
> MSN 8 with e-mail virus protection service: 2 months FREE* 
> http://join.msn.com/?page=features/virus
> 
> 
> -
> 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]



Extending RequestProcessor with Tiles

2003-07-15 Thread Pat Quinn
I have extended the org.apache.struts.action.RequestProcessor (i.e. 
processPreprocess() method) then i continued to implement tiles i.e. 
defining the plugin in my struts-config.xml.

Now on startup i get the following error:

TilesPlugin : Specified RequestProcessor not compatible with 
TilesRequestProcessor; - nested throwable: (javax.servlet.ServletException: 
TilesPlugin : Specified RequestProcessor not compatible with 
TilesRequestProcessor)
	at org.jboss.jetty.Jetty.deploy(Jetty.java:436)
	at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)

I've also upgraded to struts 1.1 and still get the same error

any ideas???

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

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


RE: Tiles and <%@ taglib>

2003-07-15 Thread Chen, Gin
That's a matter of preference and application server capabilities.
I prefer to keep them all in the same layout.jsp but I'm using jboss-3.2.0
with jetty and it doesn't support it that way.
>From what I know, only JRun currently supports that option. (Correct me if
I'm wrong someone).
Once you find an application server that supports both styles, however, it
really becomes a matter of preference.
-Tim

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 1:56 PM
To: 'Struts Users Mailing List'
Subject: Tiles and <%@ taglib>



In tiles, where should I be best putting the <%@ taglib uri="required
lib" %>? Each tile jsp with its own tags or put them all in the layout
JSP I use?

Thanks,
Erez




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



Tiles and <%@ taglib>

2003-07-15 Thread Erez Efrati

In tiles, where should I be best putting the <%@ taglib uri="required
lib" %>? Each tile jsp with its own tags or put them all in the layout
JSP I use?

Thanks,
Erez




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



RE: How do you access an application.properties value directly fr om within a class?

2003-07-15 Thread Raible, Matt
I forgot to add the simplest way in an Action class:

MessageResources resources = getResources(request);

resources.getMessage("keyName");


-Original Message-
From: Raible, Matt 
Sent: Tuesday, July 15, 2003 10:51 AM
To: 'Struts Users Mailing List'
Subject: RE: How do you access an application.properties value directly
fr om within a class?


If you're just looking for the values, grab it as a resource bundle. Here's
how I grab it in a Business Delegate:

// Get the application's messages resources
ResourceBundle resources =
ResourceBundle.getBundle("ApplicationResources");
String appDBVersion = resources.getString("webapp.db_version");

And then of course, there's errors and messages - where it grabs it
automagically:

errors.add(ActionErrors.GLOBAL_ERROR,
   new ActionError("errors.existing.user",
   userForm.getUsername(),
   userForm.getEmail()));

messages.add(ActionMessages.GLOBAL_MESSAGE,
 new ActionMessage("user.deleted",
userForm.getEmail()));

And lastly, you can get it from the servlet context in a servlet outside of
struts:

MessageResources resources =
((MessageResources)
getServletContext().getAttribute(Globals.MESSAGES_KEY));

resources.getMessage("userFormEx.username");


HTH,

Matt

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: How do you access an application.properties value directly from
within a class?


When Struts load, it grabs application.properties and stores it's keys and
values somewhere.  From within an action class I need to access a value in
application.properties.  How could one do this?

tia,
mark



-
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: How do you access an application.properties value directly from within a class?

2003-07-15 Thread Raible, Matt
If you're just looking for the values, grab it as a resource bundle. Here's
how I grab it in a Business Delegate:

// Get the application's messages resources
ResourceBundle resources =
ResourceBundle.getBundle("ApplicationResources");
String appDBVersion = resources.getString("webapp.db_version");

And then of course, there's errors and messages - where it grabs it
automagically:

errors.add(ActionErrors.GLOBAL_ERROR,
   new ActionError("errors.existing.user",
   userForm.getUsername(),
   userForm.getEmail()));

messages.add(ActionMessages.GLOBAL_MESSAGE,
 new ActionMessage("user.deleted",
userForm.getEmail()));

And lastly, you can get it from the servlet context in a servlet outside of
struts:

MessageResources resources =
((MessageResources)
getServletContext().getAttribute(Globals.MESSAGES_KEY));

resources.getMessage("userFormEx.username");


HTH,

Matt

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 10:28 AM
To: 'Struts Users Mailing List'
Subject: How do you access an application.properties value directly from
within a class?


When Struts load, it grabs application.properties and stores it's keys and
values somewhere.  From within an action class I need to access a value in
application.properties.  How could one do this?

tia,
mark



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

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



  1   2   >