RE: Non-Web-based Application with STRUTS

2001-06-29 Thread Nanduri, Amarnath


I think it is possible. You can have a fat client talk to the Action servlet
all the time and the Action Servlet forwards the response to the fat client
all the time. this way you can use the struts architecture. I don't have
experience with this but i think this will involve designing your client in
such a way that it always sends information based on the mappings in the
struts-config.xml 

In a web client, you post info to a servlet and you map each and every
response to some action in the struts-config.xml. Similarly when you post
information from your fat client you will also have to do the same thing. I
think the java.net package will help you more on how to do this ( i believe
i have done something similar before ). Hope this helps (or) start a lengthy
thread on how to do this :)

cheers,
Amar..

-Original Message-
From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 9:48 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Non-Web-based Application with STRUTS


Andy,

Perhaps you could create your application as an EJB application where the
application state, business logic, data access are all managed by the EJB
tier.  Create a set of workflow 'Session Facade' session ejb's to be your
interface between your various clients and your ejb business tier.  Also,
create a Business Delegate class which your java client classes will use to
communicate with the EJB tier (this will abstract the logic of ejb lookup
from the client/presentation logic).

Then you code your front ends to this EJB application:
1) a struts/jsp application that calls the ejb 'Session Facade' objects via
the business delegate.
2) a Java application that calls the ejb 'Session Facade' objects via the
business delegate.
3) if you are using a non-java client, then you may be able to access your
ejb layer using xml/rpc (web services).

In order for this multi-client approach to work, you may have to keep model
information that you would normally keep in the users HttpSession in the
workflow ('Session Facade') objects (otherwise you duplicate this logic in
the client.

When the application is developed this way, then the front-end applications
are simply used for view and to some degree flow of control.

See the J2EE Patterns catalog for more information on the design patterns I
mentioned above (Session Facade, Business Delegate, etc.) at
http://developer.java.sun.com/developer/restricted/patterns/J2EEPatternsAtAG
lance.html

HTH,
Michelle

- Original Message -
From: "Andreas Dejung" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 29, 2001 9:20 AM
Subject: Non-Web-based Application with STRUTS


> Hi there
>
> I have done some prototyp with Struts.
> Now a new requirement is that the application runs not only  with a
Broser.
> It should also run with a fat java client.
>
> Has somebody experiences with this?
>
> Is it possible? and if yes, with what kind of architecture?
>
>
> I very intressted in your answer
>
>
> Andy
>
>
>
>
>
>
> *** PLEASE NOTE ***
> This message, along with any attachments, may be confidential or legally
> privileged.  It is intended only for the named person(s), who is/are the
> only authorized recipients. If this message has reached you in error,
> kindly destroy it without review and notify the sender immediately. Thank
> you for your help.
> **



RE: No action

2001-06-28 Thread Nanduri, Amarnath

Mike,
  Were you able to instantiate other action classes ? If so there might
be a type in your action class name. Make sure that the Action class name
and the name you have specified in the xml file are the same. Also make sure
that in your web.xml file there is a mapping of *.do for your Action
Servlet. Thanks.

cheers,
Amar..

-Original Message-
From: Mike Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 4:16 PM
To: [EMAIL PROTECTED]
Subject: Re: No action


Too bad the extra line was caused by my mailer :(  It's not really there.
--m

- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 2:56 PM
Subject: RE: No action


> Don't leave the extra line between your 'path' and the 'type'. This causes
> the problem...
>
> cheers,
> Amar..
>
> -Original Message-
> From: Mike Thompson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 28, 2001 3:50 PM
> To: [EMAIL PROTECTED]
> Subject: No action
>
>
> I'm getting an error when linking to an action.
>
> 2001-06-28 02:29:48 - Ctx( /SecureExWeb ): 500 R( /SecureExWeb +
> /servicemanager.do + null) No action instance for path /servicemanager
could
> be created
>
> My struts-config.xml has the action entry:
> 
> type="com.instanton.secureex.web.action.service.ListServicesAction"
> name="serviceListForm"
> scope="session"
> validate="true">
> 
> 
>
> What is going on here?  Is this a classpath type problem?
> --m
>
> Michael R. Thompson
> http://www.instanton.com
> 512.439.3815



RE: No action

2001-06-28 Thread Nanduri, Amarnath

Don't leave the extra line between your 'path' and the 'type'. This causes
the problem... 

cheers,
Amar..

-Original Message-
From: Mike Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 3:50 PM
To: [EMAIL PROTECTED]
Subject: No action


I'm getting an error when linking to an action.

2001-06-28 02:29:48 - Ctx( /SecureExWeb ): 500 R( /SecureExWeb +
/servicemanager.do + null) No action instance for path /servicemanager could
be created

My struts-config.xml has the action entry:




What is going on here?  Is this a classpath type problem?
--m

Michael R. Thompson
http://www.instanton.com
512.439.3815



RE: How do I use application scope bean in JSP?

2001-06-26 Thread Nanduri, Amarnath

use   

-Original Message-
From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:53 PM
To: struts-user@jakarta. apache. org (E-mail)
Subject: How do I use application scope bean in JSP?


Hi,

I have a bean stored in application scope in a startup servlet using:

getServletContext().setAttribute(Constants.COMMON_DROP_DOWN_KEY,
commonDropDownListBean);

This bean of type CommonDropDownList has a property getResponseIndicatorList
which returns a HashMap. 

I want to use this HashMap for the  in my JSP like this:



 


(Constants.COMMON_DROP_DOWN_KEY is defined as "common_lists" )

But I get this error listed below. 
 

javax.servlet.ServletException: No getter method for property
responseIndicatorList of bean common_lists
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
at
_0002fSubmitQuotes_0002ejspSubmitQuotes_jsp_4._jspService(_0002fSubmitQuotes
_0002ejspSubmitQuotes_jsp_4.java:1265)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:194)
at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:1727)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:194)
at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:1727)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)



Could someone please tell me what am I doing wrong.

TIA.

-Nimmi



RE: iterate over a HashMap

2001-06-26 Thread Nanduri, Amarnath

Tried it. Got a runtime (or is it compile time ? ) exception. Thanks.

cheers,
Amar..

-Original Message-
From: Mike Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:19 PM
To: [EMAIL PROTECTED]
Subject: Re: iterate over a HashMap













should work.
--m

- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 2:17 PM
Subject: RE: iterate over a HashMap


> Mike,
>Thanks a lot for your help. I am trying to figure out how to typecast
the
> 'value' object into type DataBean so that i can call one of its methods.
> Maybe i need to do something fancy to satisfy the compiler and the JVM.
>
> cheers,
> Amar..
>
> -Original Message-
> From: Mike Thompson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 26, 2001 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: iterate over a HashMap
>
>
> Normally, each object exposed by the iterate tag is an element of the
> underlying collection you are iterating over. However, if you iterate over
a
> Map, the exposed object is of type Map.Entry that has two properties:
>
>
>   a.. key - The key under which this item is stored in the underlying Map.
>   b.. value - The value that corresponds to this key.
> So
> >  > scope="session" >
>
> the property itemEntry.key is the key in the hashmap.
> the property itemEntry.value is your bean, which you may do something like
> itemEntry.value.name
>
> Hope this helps.
> --m
>
>
>
> - Original Message -
> From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 26, 2001 2:01 PM
> Subject: iterate over a HashMap
>
>
> >
> > How do i iterate over a HashMap ? The key is a String but the value is
an
> > Object of a certain type (example .. com.agilquest.bean.DataBean ).
> >
> > I need to call a getter in the 'value  i.e  dataBean.getName() ;
> >
> > Below is the code i use...The value is calling the toString() of
DataBean.
> I
> > need to call the getName() of DataBean. thanks a lot.
> >
> > cheers,
> > Amar..
> >
> >  > scope="session" >
> >
> >
> >   <%-- show the key in the HashMap
> > --%>
> >  > property="key"/>
> >
> > 
> >
> >   <%-- show the value i.e DataBean
> > and call its getName() --%>
> >  > property="value" />
> > 
> >
> >
> >   



RE: iterate over a HashMap

2001-06-26 Thread Nanduri, Amarnath

I figured it out. I changed my HashMap into a collection and started
iterating over the collection. Since the value object in the HashMap
contains the key also ( the business side is returning a HashMap instead of
a collection btw) , i was able to iterate through the collection and so
typecast each object to its exact data type. Thanks everybody for your help.

cheers,
Amar..

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:17 PM
To: '[EMAIL PROTECTED]'
Subject: RE: iterate over a HashMap


Mike,
   Thanks a lot for your help. I am trying to figure out how to typecast the
'value' object into type DataBean so that i can call one of its methods.
Maybe i need to do something fancy to satisfy the compiler and the JVM.

cheers,
Amar..

-Original Message-
From: Mike Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:09 PM
To: [EMAIL PROTECTED]
Subject: Re: iterate over a HashMap


Normally, each object exposed by the iterate tag is an element of the
underlying collection you are iterating over. However, if you iterate over a
Map, the exposed object is of type Map.Entry that has two properties:


  a.. key - The key under which this item is stored in the underlying Map.
  b.. value - The value that corresponds to this key.
So
>  scope="session" >

the property itemEntry.key is the key in the hashmap.
the property itemEntry.value is your bean, which you may do something like
itemEntry.value.name

Hope this helps.
--m



- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 2:01 PM
Subject: iterate over a HashMap


>
> How do i iterate over a HashMap ? The key is a String but the value is an
> Object of a certain type (example .. com.agilquest.bean.DataBean ).
>
> I need to call a getter in the 'value  i.e  dataBean.getName() ;
>
> Below is the code i use...The value is calling the toString() of DataBean.
I
> need to call the getName() of DataBean. thanks a lot.
>
> cheers,
> Amar..
>
>  scope="session" >
>
>
>   <%-- show the key in the HashMap
> --%>
>  property="key"/>
>
> 
>
>   <%-- show the value i.e DataBean
> and call its getName() --%>
>  property="value" />
> 
>
>
>   



RE: iterate over a HashMap

2001-06-26 Thread Nanduri, Amarnath

Mike,
   Thanks a lot for your help. I am trying to figure out how to typecast the
'value' object into type DataBean so that i can call one of its methods.
Maybe i need to do something fancy to satisfy the compiler and the JVM.

cheers,
Amar..

-Original Message-
From: Mike Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:09 PM
To: [EMAIL PROTECTED]
Subject: Re: iterate over a HashMap


Normally, each object exposed by the iterate tag is an element of the
underlying collection you are iterating over. However, if you iterate over a
Map, the exposed object is of type Map.Entry that has two properties:


  a.. key - The key under which this item is stored in the underlying Map.
  b.. value - The value that corresponds to this key.
So
>  scope="session" >

the property itemEntry.key is the key in the hashmap.
the property itemEntry.value is your bean, which you may do something like
itemEntry.value.name

Hope this helps.
--m



- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 2:01 PM
Subject: iterate over a HashMap


>
> How do i iterate over a HashMap ? The key is a String but the value is an
> Object of a certain type (example .. com.agilquest.bean.DataBean ).
>
> I need to call a getter in the 'value  i.e  dataBean.getName() ;
>
> Below is the code i use...The value is calling the toString() of DataBean.
I
> need to call the getName() of DataBean. thanks a lot.
>
> cheers,
> Amar..
>
>  scope="session" >
>
>
>   <%-- show the key in the HashMap
> --%>
>  property="key"/>
>
> 
>
>   <%-- show the value i.e DataBean
> and call its getName() --%>
>  property="value" />
> 
>
>
>   



RE: iterate over a HashMap

2001-06-26 Thread Nanduri, Amarnath

Thanks. This did not help me though..

cheers,
Amar..

-Original Message-
From: Mike Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:01 PM
To: [EMAIL PROTECTED]
Subject: Re: iterate over a HashMap


Goto http://jakarta.apache.org/struts/struts-logic.html#iterate
--m

- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 2:01 PM
Subject: iterate over a HashMap


>
> How do i iterate over a HashMap ? The key is a String but the value is an
> Object of a certain type (example .. com.agilquest.bean.DataBean ).
>
> I need to call a getter in the 'value  i.e  dataBean.getName() ;
>
> Below is the code i use...The value is calling the toString() of DataBean.
I
> need to call the getName() of DataBean. thanks a lot.
>
> cheers,
> Amar..
>
>  scope="session" >
>
>
>   <%-- show the key in the HashMap
> --%>
>  property="key"/>
>
> 
>
>   <%-- show the value i.e DataBean
> and call its getName() --%>
>  property="value" />
> 
>
>
>   



iterate over a HashMap

2001-06-26 Thread Nanduri, Amarnath


How do i iterate over a HashMap ? The key is a String but the value is an
Object of a certain type (example .. com.agilquest.bean.DataBean ). 

I need to call a getter in the 'value  i.e  dataBean.getName() ;

Below is the code i use...The value is calling the toString() of DataBean. I
need to call the getName() of DataBean. thanks a lot.

cheers,
Amar..




  <%-- show the key in the HashMap
--%>




  <%-- show the value i.e DataBean
and call its getName() --%>
 



  



RE: Implementing 2 new scopes using Struts

2001-06-25 Thread Nanduri, Amarnath



Jonathan,
 
>One scope will work across 
(between) web-applications:  Ex. user logs on, and an object 
representing the users values and 
state is
 >placed into a scope where 
ALL WEB APPLICATIONS can see it.
 
   Use JNDI and throw the user info up the jndi 
tree
 
I 
didn't understand your second scope. Can you elaborate. 
Thanks.
 
cheers,
Amar..
 
  

  -Original Message-From: Jonathan Asbell 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, June 25, 2001 8:24 
  AMTo: [EMAIL PROTECTED]Subject: 
  Implementing 2 new scopes using Struts
  I will be implementing new scopes using Struts 
  for our unique needs, and they need to be application 
  server independent.  
   
  One scope will work 
  across (between) web-applications:  Ex. user logs on, and an object 
  representing the users values and state is placed into a scope where ALL WEB 
  APPLICATIONS can see it.
   
  Another scope is 
  restricted to specified directories inside of an application:  Ex. 
  data saved would only be visible when inside a specific 
  sub-directory.
   
  I am currently examining 
  the 2.3 servlet spec.  Does anyone have any advice as to what to watch 
  out for in implementing this considering I want to be able to be 
  compatible with servlet containers in general and leverage container 
  management and web.xml configuration.  Could anyone refer me to some 
  specific sections in the servlet spec that you feel I should pay specific 
  attention to while I am doing this. 
   
  Thank you
  Jonathan


RE: [EJB] Design Patterns (was JavaReport ...)

2001-06-21 Thread Nanduri, Amarnath


  I would suggest using interfaces to talk to the Actions / Action Forms.
This way there would be no confusion about importing the struts libraries
when the users want to change the front end framework to say Cocoon (or)
Velocity.

Just my 0.02$

cheers,
Amar..




-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 9:04 AM
To: [EMAIL PROTECTED]
Subject: Re: [EJB] Design Patterns (was JavaReport ...)


The ActionForm beans can contain nested references, so you could just
set some other bean to it, then refer to myBean.propertyThis and
myBean.propertyThat. Of course, the other bean would have to have
standard String accessor and mutators, which is where it starts to fall
down. The other beans may need to use native types, and would want to
reject or transform an incoming String value being set to type. So if
you need two storage locations, joining the two classes loses its edge.

In general, I would say that ActionForms can be coupled to other beans,
but other beans should not be coupled to ActionForm bean (import the
Struts class). Because, in another environment, the ActionForm beans
might be replaced with another class that hooked up to non-HTTP user
interface (say, Swing), and we would want to be able to drop those in.
Of course, the other beans could be designed to accept values from any
given JavaBean via reflection, which would include an ActionForm bean.

It's my feeling that proper MVC/J2EE design implies that we are going to
be stuck with a set of ActionForm beans and a set of other beans, and
need to find the best way to transfer data between the two. 

Jonathan Asbell wrote:
> 
> I was on this track in another thread where I was saying...
> 
> "What if ActionForm was an inner class to a Value object.  Or, what if a
> Value object had a reference to an ActionForm which when filling with
> parameters we did ActionFormValue.getActionForm(), filled it, complete
"does
> it exist" checking and non-business object validation checking, and then
do
> a ActionFormValue.setActionForm(ActionForm myform) to set it back, which
> would fill the ActionFormValue object with the values in the ActionForm.
An
> "ActionValue" could hold 1 or more ActionsForm(s) , or could take
ActionForm
> as a parameter, with which it would copy and "nativeize" the data in the
> ActionForm.  In this case an ActionValue would hold specific fileds for
the
> beans it uses."
> 
> My point here,though I hope it is apparent, is that we need to send
> value ojects through the system in a way in which it can complement/work
> with Struts.



RE: creating ActionError inside a jsp page

2001-06-20 Thread Nanduri, Amarnath

Ronald,

 Thanks for your excellent suggestion. I was thinking of extending the
ActionError object to make a confirmation msg object. This way logically
there would be a clean distinction between error msgs and confirmation msgs.
The struts  tag would then show both the messages. Since this
tag exists on every page i do not need to write my own tag and hence keep an
extra tag in the jsp pages. Any suggestions/comments ?

cheers,
Amar..

-Original Message-
From: Roland Huss [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 5:34 PM
To: [EMAIL PROTECTED]
Subject: Re: creating ActionError inside a jsp page


Hi,

>  Is it possible to create an Action Error object inside a jsp page. When i
> am trying to forward the user from one page to an other page, i need to
show
> a confirmation message to the user (in the new page) and i was thinking of
> using an Action Error object. thanks.

I would recommend to use an own tag for informational messages to make
the separation clean between errors and messages.

For example, you could have a method in your (base) action for setting
info messages into the session under some ID.  A custom tag checks for
the existence of a session attribute ID and prints the stored info
message (and finally cleans up the session, of course).

cu...
-- 
...roland huss
 consol.de



creating ActionError inside a jsp page

2001-06-20 Thread Nanduri, Amarnath


Hi All,

 Is it possible to create an Action Error object inside a jsp page. When i
am trying to forward the user from one page to an other page, i need to show
a confirmation message to the user (in the new page) and i was thinking of
using an Action Error object. thanks.


cheers,
Amar..



RE: Null Pointer Exception when using on Tomcat 3.2

2001-06-15 Thread Nanduri, Amarnath

Never mind. I figured it out. I forgot to include my custom library and this
check was bypassed.

cheers,
Amar..

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 15, 2001 9:52 AM
To: '[EMAIL PROTECTED]'
Subject: Null Pointer Exception when using on Tomcat 3.2




Hi everybody,

  I am getting this exception when i try to reference a jsp page directly
without going through an Action class. Basically the user is not even logged
in(when i get this exception). I do have a  tag which is a
modified version of the  that comes with the example app. Can
somebody point out as to why i am getting this error ? Please note that i
have bookmarked the page and then opened this page (without going through
the ActionServlet). Thanks a lot.

cheers,
Amar..


2001-06-15 09:47:23 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007
2001-06-15 09:49:09 - Ctx( /onboard ): Exception in: R( /onboard +
/resource/modify_CategoryAndType.jsp + null) - javax.
servlet.ServletException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
at
resource._0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005
fCategoryAndType_jsp_0._jspServic
e(_0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005fCatego
ryAndType_jsp_0.java:950)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.lang.NullPointerException
at
resource._0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005
fCategoryAndType_jsp_0._jspServic
e(_0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005fCatego
ryAndType_jsp_0.java:219)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)



Null Pointer Exception when using on Tomcat 3.2

2001-06-15 Thread Nanduri, Amarnath



Hi everybody,

  I am getting this exception when i try to reference a jsp page directly
without going through an Action class. Basically the user is not even logged
in(when i get this exception). I do have a  tag which is a
modified version of the  that comes with the example app. Can
somebody point out as to why i am getting this error ? Please note that i
have bookmarked the page and then opened this page (without going through
the ActionServlet). Thanks a lot.

cheers,
Amar..


2001-06-15 09:47:23 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007
2001-06-15 09:49:09 - Ctx( /onboard ): Exception in: R( /onboard +
/resource/modify_CategoryAndType.jsp + null) - javax.
servlet.ServletException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
at
resource._0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005
fCategoryAndType_jsp_0._jspServic
e(_0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005fCatego
ryAndType_jsp_0.java:950)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.lang.NullPointerException
at
resource._0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005
fCategoryAndType_jsp_0._jspServic
e(_0002fresource_0002fmodify_0005fCategoryAndType_0002ejspmodify_0005fCatego
ryAndType_jsp_0.java:219)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)



RE: mailing list

2001-06-13 Thread Nanduri, Amarnath



good 
one...

  -Original Message-From: Jonathan 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, June 13, 2001 3:11 
  PMTo: [EMAIL PROTECTED]Subject: Re: mailing 
  list
  a new mailbox ?
  ;^>
  
- Original Message - 
From: 
[EMAIL PROTECTED] 
To: [EMAIL PROTECTED] 

Sent: Wednesday, June 13, 2001 2:45 
PM
Subject: mailing list
  What do I need to do 
to get off of this mailing list?  It's overflowing my inbox! 



problem with using Javascript

2001-06-13 Thread Nanduri, Amarnath

Hi all,

  I am facing a problem when using Javascript with . Below is the
jsp code segment and the html that was generated. My problem is that the
jsessionid is being generated and this is messing up my webpage. I keep
getting javascript errors. Any help on an alternate suggestion would be very
helpful. thanks a lot.

cheers,
Amar..


jsp


 





generated html
--





RE: bean:write Tag and polymorphic behavior

2001-06-06 Thread Nanduri, Amarnath

David,

 Thanks for the info. I do have the setters. Too lazy to include them in
my actual mail.

cheers,
Amar..

-Original Message-
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 2:18 PM
To: [EMAIL PROTECTED]
Subject: Re: bean:write Tag and polymorphic behavior


Struts uses reflection.  So if the method is there, it
will find it.  You will need a setter though for the
key method or it will generate errors.

Here is an excerpt from the PropertyUtils
documentation.

Utility methods for using Java Reflection APIs to
facilitate generic property getter and setter
operations on Java objects. Much of this code was
originally included in BeanUtils, but has been
separated because of the volume of code involved. 

In general, the objects that are examined and modified
using these methods are expected to conform to the
property getter and setter method naming conventions
described in the JavaBeans Specification (Version
1.0.1). No data type conversions are performed, and
there are no usage of any PropertyEditor classes that
have been registered, although a convenient way to
access the registered classes themselves is included. 

David
--- "Nanduri, Amarnath"
<[EMAIL PROTECTED]> wrote:
> Hi my fellow Strutters,
> 
> 
> got an interesting question for you all to
> ponder. I am using the tag
> 
>  property="superclassObject.key" /> in my jsp
> pages.  
> 
> 
> WILL THIS WORK ? Is struts smart enough to know that
> i am returning a
> subclass and so can call its private variable using
> the getter method ? I
> know that introspection is being performed inside.
> Some expert advise is
> helpful...
> 
> I am enclosing the code for this..
> 
> public class ABCForm extends ActionForm
> {
> 
>   public  SuperClass  getSuperClassObject()
>   {
> // basically it returns a Subclass upcasted to
> the superclass.
> return  superclassObject ;
>   }
> 
> 
> }
> 
> 
>  public  SuperClass
>  {
>
>  }
> 
> 
>  public  SubClass extends  SuperClass
>  {
>private String key ;
> 
>public  String getKey()
>{
>  return key ;
>}
>  }  


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



bean:write Tag and polymorphic behavior

2001-06-06 Thread Nanduri, Amarnath

Hi my fellow Strutters,


got an interesting question for you all to ponder. I am using the tag

 in my jsp
pages.  


WILL THIS WORK ? Is struts smart enough to know that i am returning a
subclass and so can call its private variable using the getter method ? I
know that introspection is being performed inside. Some expert advise is
helpful...

I am enclosing the code for this..

public class ABCForm extends ActionForm
{

  public  SuperClass  getSuperClassObject()
  {
// basically it returns a Subclass upcasted to the superclass.
return  superclassObject ;
  }


}


 public  SuperClass
 {
   
 }


 public  SubClass extends  SuperClass
 {
   private String key ;

   public  String getKey()
   {
 return key ;
   }
 }  



RE: Displaying the jsp forwarded by actionforward with the struts-form.tld

2001-06-06 Thread Nanduri, Amarnath



 
 
 
Replace the value=<%= 
request.getAttribute("ejbTitle") %>    with value=' <%= 
request.getAttribute("ejbTitle") %> ' 
 
Note the use of single 
quotes. It should work.
 
cheers,
Amar..

  -Original Message-From: ameer 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, June 06, 2001 3:02 
  AMTo: StrutsSubject: Displaying the jsp forwarded by 
  actionforward with the struts-form.tld
  Im facing problem in displaying a forwarded jsp where in the form values 
  are coming from the request attributes set in action class. im getting the 
  attribute values but the struts-form tags are not getting converted to what it 
  is supposed to. my jsp is like this .. the tag works fine for the first input 
  jsp file . since it is just a submit form. but in my forwarded form i have 
  submitted to the same servlet. can you suggest soln here . my jsp code goes 
  like this for the forwarded page. 
  **
  <%@ page language="java" %><%@ taglib 
  uri="/WEB-INF/struts-form.tld" prefix="form" %>
   
  MusicCD 
  Display<% out.println(request.getAttribute("ejbUpc")); out.println(request.getAttribute("ejbTitle")); out.println(request.getAttribute("ejbArtist")); out.println(request.getAttribute("ejbType")); out.println(request.getAttribute("ejbPrice"));%>
   
         Music CD 
  Details  CD 
  #  
  maxlength="30" size="30" 
  /> Title  
  maxlength="30" 
  size="30"/> Artist  
  maxlength="30" 
  size="30"/> Type  
  maxlength="30" 
  size="30"/> Price  
  maxlength="30" 
  size="30"/>   
  
   
  thanx in adv.
  Ameer Hussain SSs/w engineerYashaa Infotech Pvt.Ltd.#14 , 
  10th Main, HAL 3rd StageBangalore 560075phone: 5294430/53 http://www.yashaa.com


RE: Query: ActionMappings

2001-06-05 Thread Nanduri, Amarnath

yes. 

-Original Message-
From: Upadhye, Sujit (GEAE, Foreign National)
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 5:52 PM
To: [EMAIL PROTECTED]
Subject: Query: ActionMappings


Hello,

In local-forwards, can I forward the control to another Action object
instead of forwarding to a JSP?

Sujit Upadhye



RE: Setting value to a textarea?

2001-06-05 Thread Nanduri, Amarnath

Alex,

  If you don't fill in the 'value' attribute , struts will call the
form.getRequisitionLines().getDescription() (where form is mapped in the
struts-config.xml file for your action) and populate the 'value' attribute.
However if you polulate the 'value' attribute, struts will show that value
as it is..(i.e think of it as a constant u want to display). 

Hope this clarifies what u want to do.

cheers,
Amar..

-Original Message-
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 4:15 PM
To: Struts
Subject: Setting value to a textarea?


Hi,

I am trying to set the value of a textarea that I have created via:






When the page is displayed the textarea text is populated with
"requisitionLines.pcitem.name" not the value held in the bean.

Could someone tell me what I am doing wrong?

Thanks

Alex



RE: Resources clarification - is there a work around

2001-05-31 Thread Nanduri, Amarnath

Hi Guys,

From my personal experience it would not be a bad idea for struts to
support multiple resource bundles. I will explain my reasons below.

At present struts has one resource bundle in which you can include error
messages , confirmation messages , labels on html fileds etc For a big
application ( like i am on right now. We are going to have > 50 jsp pages
minimum) it is quite a pain in the neck to add properties to a single file.
Besides the developers having to compete with one another to checkout the
properties file ( from source safe ) maintaining it is an another pain.

   One more problem we encountered is nested exceptions deep in the EJB's.
Trying to throw the error msgs (which ofcourse have to be internationalized)
and showing it to the user, it was somewhat of a problem to define all the
correct error messages in the same property file. After sometime we were
able to coordinate properly and get stuff back on track (without losing
tempers). 

   I would propose that struts 1.1 make it a standard to have separate
Resource Bundles for different categories. I do not agree with one Resource
Bundle per page as this would lead to too much confusion. 

   For example, all the error msgs would be in a Resource Bundle by
themselves. Confirmation msgs would have their own Resource Bundle. HTML
related fields will have their own Resource Bundles etc ..

   From a performance point of view which would be more efficient ? Having a
single Resource Bundle (or) Multiple Resource Bundles ? Which one can give
the user faster lookup access ? 


  At present we have close to 2000+ (properties + error msgs) in the
properties file and the number would most likely quadruple by the time we
take it to production. I would certainly like to hear your opinions on
thisesp from people who have deployed their applications...

just my 2cents

cheers,
Amar..


   

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 31, 2001 10:28 AM
To: [EMAIL PROTECTED]
Subject: Re: Resources clarification - is there a work around


Hi Peter.  Read the whole thread and you will see some good examples as to
why I want to do this.

I think I will end up doing some surgery on the struts classes.  I will
associate the page I am forwarding to with a properties file, maybe inside
the struts-config.  That will mean I will have to look at the dom
manipulation which gets the values and ad another group of items (the
associated properties file) to a hashtable or object. I will put the
properties files in the same directory as the jsp page but protected.  I
will try to protect all files that end in ".properties".

I would love to hear suggestions from Niall, Ted, Craig, Hal, Jeff, Nanduri,
Dave etc


- Original Message -
From: "Peter Alfors" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 31, 2001 10:03 AM
Subject: Re: Resources clarification - is there a work around


> We are currently using two different resource bundles.  One for our
messages and
> another for our constants (that define
> web look and feel).  To do this, we overrode the init() method in the
> ActionServlet and added another method to initialize a second bundle into
a
> different session attribute.
> This works well for 2 different bundles, but it would not be practical for
a
> large number or bundles (one per page).
>
> Maybe there would be a way to initialize all of the page bundles at
startup?
> Some sort of loop or somethine?
> I don't have any suggestions on how this would work, but maybe it is a
starting
> point??
>
> One supporting reason for a single bundle would be this...  It allows you
to
> easily keep consistent naming across your app.
> For instance, if each of your pages has the label "Id", but then later on
you
> (or the customer) decide that "Name" is a better choice, you only have to
change
> it in one place.  There are other situations as well, this is just one.
> Also, creating new locales is as simple as handing a single resource
bundle over
> to your translater, rather than 100 different bundles to duplicate.
> As for naming problems, there is a simple solution.  Use a naming strategy
for
> each key.
>
> .=Value
> or
> common.=Value <-- if this is common across all pages.
>
> HTH,
> Pete
>
>
> Jonathan Asbell wrote:
>
> > Thanks Pete.  However it just seems strange that Struts just offers one
big
> > resource file for each Local.  I have developed 3 international sites,
and I
> > can safely say that when a set of resources are associated with a
particular
> > page it is much easier to manage than 1 resources for all pages.  Has
anyone
> > hacked at the Struts code to get around this?  I dont like the
concatenating
> > idea because it is too easy to have duplicates; and you probably want to
use
> > the same resource names anyway to keep a consistency.  Anyone else have
any
> > ideas?
> >
> > - Original Message -
> > From: "Peter Alfors" <[EMAIL PROTECTED]>
> > To

RE: Production uses of Jakarta STRUTS 1.0

2001-05-25 Thread Nanduri, Amarnath

We are using this in our development of a top-notch heavy duty application.
So far it works like a charm and we are pleased with what it can do.

cheers,
Amar..

-Original Message-
From: Ronne, David [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 25, 2001 4:37 PM
To: '[EMAIL PROTECTED]'
Subject: Production uses of Jakarta STRUTS 1.0


As part of the Architecture and Technology group in our organization, we are
recommending the use of the Struts framework over a proprietary one
currently in use by one of our development groups. 

They want to know if this is real or just vapor-ware. 

Is anyone aware of current production uses of the framework to
prove it works in real life?


Thanks in Advance
Dave Ronne
Principle SWE A&T
Fidelity Corp.



RE: Removing session-scoped form from the session

2001-05-25 Thread Nanduri, Amarnath

Yes it is available under the name in the struts-config.xml file.

If form is removed from session and next time you request a form, it will
create a new form object for you.

cheers,
Amar..

-Original Message-
From: Fabien Modoux [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 25, 2001 12:21 PM
To: [EMAIL PROTECTED]
Subject: Removing session-scoped form from the session


I would like to know how I can remove a session-scoped form
from the current session once I don't need it anymore. Is it
stored in the session under the form-bean.name attribute in
the struts-config.xml file? If yes, removing the form from
the session makes it available for other requests directly?

Thanks,

-Fabien Modoux

-  
Fabien Modoux,
Voicemate - http://www.voicemate.com



RE: Upload and Dir listing tab libs

2001-05-25 Thread Nanduri, Amarnath

Nope. If you get the chance to write one, please post it to the list so that
others (like me) can take a look at them, modify them to make it more
powerful and maybe use it in our apps. Thanks.

cheers,
Amar..

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 25, 2001 7:06 AM
To: [EMAIL PROTECTED]
Subject: Upload and Dir listing tab libs


Hi All,

We have the upload tag lib that work great in struts. But is anyone aware of
tag libs to assist in the listing/presentation of a directory within a jsp ?

Jon.



RE: subclassing ActionServlet?

2001-05-25 Thread Nanduri, Amarnath

Kazumi ,

 You need to look at the struts-example.war application for how to do
this. Basically create your own servlet where you initialize your beans.
Once the beans are initialized , put them in application scope. Then startup
your action servlet. To do this you need to use the web.xml file to specify
the order in which the servlets need to be loaded. This way you will not be
tinkering with the ActionServlet which will be a good thing if infuture you
want to migrate to struts1.1

cheers,
Amar..

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 10:38 PM
To: [EMAIL PROTECTED]
Subject: subclassing ActionServlet?


Hello struts-users,

My webapp needs bunch of beans that should be available
all the time and accessible from all JSP pages, so I guess I
have to create the beans at the startup time and set them to
the application context.

How should I do this? My candidates are,

1) create a subclass of ActionServlet and do it there,
2) create a subclass of Servlet (unrelated to ActionServlet)
and do it there.

Which is better, or are there any other standard ways?
I don't see any examples that use subclasses of ActionServlet,
and I am wondering if there are some reasons not to.

Thanks in advance,

- kazumi



RE: struts framework without its TAG LIBRARIES in jsp pages how?

2001-05-24 Thread Nanduri, Amarnath

Sanjay,

   Use the  tag . It will automatically create your bean. Use
jsp tags to set the properties of the bean. In your form post, when you call
the action.do , the ActionServlet will automatically populate the bean (the
bean that is mapped to this action in the struts-config.xml file), call its
validate() method and if everything is satisfactory call the perform()
method on the Action. A best way to deal with this is to code a simple
example.

cheers,
Amar..

-Original Message-
From: Sanjay Melinamani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 1:56 PM
To: '[EMAIL PROTECTED]'
Subject: RE: struts framework without its TAG LIBRARIES in jsp pages
how?


but my question is how? If we use HTML, how is the "ActionForm" gets
delegated to Action::perform() method? 
I guess we have to explicitly use the ActionForm bean and call its "set"
methods...I am not sure about this !

If u suggest me as how is the ActionForm will be delegated to the
Action::perfom method, that would be great !

thanx
sanjay


> -----Original Message-
> From: Nanduri, Amarnath [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 5:21 AM
> To:   '[EMAIL PROTECTED]'
> Subject:  RE: struts framework without its TAG LIBRARIES in jsp pages
> how?
> 
> You can ignore the Tag Libraries and still use the ActionServlet, Actions
> and ActionForms functionality. Write your own html . The beauty of using
> the
> Tag Libraries is that they are fully internationalized. But if
> internationalization is not an issue, then by all means write your own
> html
> without using the Tag Libraries.
> 
> 
> cheers,
> Amar..
> 
> -Original Message-
> From: Sanjay Melinamani [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 23, 2001 7:49 PM
> To: [EMAIL PROTECTED]
> Subject: struts framework without its TAG LIBRARIES in jsp pages how?
> 
> 
> > hi,
> > I am trying to make use of struts framework in our application. But can
> I
> > implement the frame work "without" using its Tag libraries? If so how
> can
> > I do it? Basically I do not wnat to use Struts TAG LIBRARIES in my JSP
> > pages.
> > 
> > thanx
> > regards
> > sanjay
> > 



RE: 64K limit

2001-05-24 Thread Nanduri, Amarnath

yeah ... check the archives . Somebody has posted a solution. Alternately
you can go to  http://husted.com/about/struts   for the solution

-Original Message-
From: Mat Diss [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 4:13 PM
To: [EMAIL PROTECTED]
Subject: 64K limit


Has anyone come across the problem whereby the 64k method limit is 
reached as Jasper puts all the generated Java into the _jspService method?

If I have a page with a lot of custom tags in it, I get this problem.

If you have come across the problem, have you found a way around it?

Cheers

Mat.



RE: struts framework without its TAG LIBRARIES in jsp pages how?

2001-05-24 Thread Nanduri, Amarnath

You can ignore the Tag Libraries and still use the ActionServlet, Actions
and ActionForms functionality. Write your own html . The beauty of using the
Tag Libraries is that they are fully internationalized. But if
internationalization is not an issue, then by all means write your own html
without using the Tag Libraries.


cheers,
Amar..

-Original Message-
From: Sanjay Melinamani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 7:49 PM
To: [EMAIL PROTECTED]
Subject: struts framework without its TAG LIBRARIES in jsp pages how?


> hi,
> I am trying to make use of struts framework in our application. But can I
> implement the frame work "without" using its Tag libraries? If so how can
> I do it? Basically I do not wnat to use Struts TAG LIBRARIES in my JSP
> pages.
> 
> thanx
> regards
> sanjay
> 



RE: Donating Xml Configurable Character filter

2001-05-23 Thread Nanduri, Amarnath

Jonathan,

Nice answer :) I learnt a lot from you today.
Amar..

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 3:24 PM
To: [EMAIL PROTECTED]
Subject: Re: Donating Xml Configurable Character filter


If you look closely, you will first see that the mapping is in memory, and
that it only does conversions for values that are in the map.  What is not
in the map is not changed.  If a value IS in the map, it will convert it to
what you have mapped it to.  Regarding "overkill", it may or may not be.  I
needed to use it because we are having the biggest problems with xml,
unicode characters, utf-8, and internationalization.  It is not necessarily
to be used on the web tier alone, although it can be.  You guys use that
"fast Hash Map", which could be employd here since its read only.  Also,
people on the list have been looking for a character filter, and here is
one.  It may be useful or not.  You guys are the brains around here ;^>  I'm
just trying to learn from you.=)

Jonathan

- Original Message -----
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 1:54 PM
Subject: RE: Donating Xml Configurable Character filter


> Hi Jonathan,
>
>  This is interesting stuff you are sending. Don't you think it is a
bit
> of an overkill ? Correct me if i am wrong, on a heavy traffic website i am
> thinking this might slow down the applicationa  lot. I am thinking of a
> simple filter which use the methods that String class provides.
>
>  I think you can basically convert every string into a char array.
> Depending on the flag you convert either the allowedCharacters (or)
> disallowedCharacters into a char array. For every element of this array
you
> try to find an index into this input String. If index is != -1, the
> character is present in the input string. You then decide what you want to
> do with the character. Since i will be dealing with international
characters
> aswell, i can put the characters as an unicode value in the properties
file.
> That way i will have flexibility and ease of maintenance of the character
> set that i want to control in an application. Since the user input (per
> field) can at the max be around 50-250 characters, i don't think it will
be
> a performance hit. On a heavy volume application ( with > 100 users at a
> time ) i wonder what will be the performance hit ? I would really
appreciate
> your feedback on this. Thanks a lot.
>
> cheers,
> Amar..
>
>
> -Original Message-
> From: Jonathan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 23, 2001 1:03 PM
> To: [EMAIL PROTECTED]
> Subject: Donating Xml Configurable Character filter
>
>
>
> Character Filter Donation
>
>
> - Original Message -
> From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, May 23, 2001 9:39 AM
> Subject: Suggestions for Struts 1.1 TODO LIST  Request Filtering
> technology for Struts
>
>
> > Hi Everybody,
> >
> >  I would really like the opinion of the big heavyweights who
designed
> > this framework. I have a small but important suggestion to make for the
> > struts 1.1 todo list.
> > So far struts does not implement a filtering technology for incoming
> > requests which is very important in this hacker dominated world. I have
a
> > simple solution / change that can be made to the current version of
> struts
> > which would implement this filtering technology. This filter basically
> > filters out unwanted characters submitted by the user so that the
> database
> > will not be harmed. I propose that the BeanUtils.populate() method be
> > modified to include a filter(before calling the setters on the
> corresponding
> > form object). The filter() method takes the bad / unwanted characters
out
> > and give back a clean string. This clean string is then set in the
> > corresponding form setter method. This filter would read from a
> properties
> > file the following criteriaThe structure of the properties file
would
> > be..
> >
> > # allowed characters in the database
> > allowedCharacters = askbdsvASDASDA123412321...
> >
> > # disallowed characters in the database
> > disallowedCharacters = ~`!@#$%^&*()-|\\<,>.?/:;"'
> >
> > # replacement character. For every disallowed character in the input
> > string,
> > # it would be replaced by this character
> > replacementChar = "-"
> >
> > # This flag specifies whether to check the incoming string for
> > allowedCharacters

RE: Donating Xml Configurable Character filter

2001-05-23 Thread Nanduri, Amarnath

Hi Jonathan,

 This is interesting stuff you are sending. Don't you think it is a bit
of an overkill ? Correct me if i am wrong, on a heavy traffic website i am
thinking this might slow down the applicationa  lot. I am thinking of a
simple filter which use the methods that String class provides. 

 I think you can basically convert every string into a char array.
Depending on the flag you convert either the allowedCharacters (or)
disallowedCharacters into a char array. For every element of this array you
try to find an index into this input String. If index is != -1, the
character is present in the input string. You then decide what you want to
do with the character. Since i will be dealing with international characters
aswell, i can put the characters as an unicode value in the properties file.
That way i will have flexibility and ease of maintenance of the character
set that i want to control in an application. Since the user input (per
field) can at the max be around 50-250 characters, i don't think it will be
a performance hit. On a heavy volume application ( with > 100 users at a
time ) i wonder what will be the performance hit ? I would really appreciate
your feedback on this. Thanks a lot.

cheers,
Amar..


-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 1:03 PM
To: [EMAIL PROTECTED]
Subject: Donating Xml Configurable Character filter



Character Filter Donation


- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 9:39 AM
Subject: Suggestions for Struts 1.1 TODO LIST  Request Filtering
technology for Struts


> Hi Everybody,
>
>  I would really like the opinion of the big heavyweights who designed
> this framework. I have a small but important suggestion to make for the
> struts 1.1 todo list.
> So far struts does not implement a filtering technology for incoming
> requests which is very important in this hacker dominated world. I have a
> simple solution / change that can be made to the current version of
struts
> which would implement this filtering technology. This filter basically
> filters out unwanted characters submitted by the user so that the
database
> will not be harmed. I propose that the BeanUtils.populate() method be
> modified to include a filter(before calling the setters on the
corresponding
> form object). The filter() method takes the bad / unwanted characters out
> and give back a clean string. This clean string is then set in the
> corresponding form setter method. This filter would read from a
properties
> file the following criteriaThe structure of the properties file would
> be..
>
> # allowed characters in the database
> allowedCharacters = askbdsvASDASDA123412321...
>
> # disallowed characters in the database
> disallowedCharacters = ~`!@#$%^&*()-|\\<,>.?/:;"'
>
> # replacement character. For every disallowed character in the input
> string,
> # it would be replaced by this character
> replacementChar = "-"
>
> # This flag specifies whether to check the incoming string for
> allowedCharacters
> # or disallowedCharacters.
> # 1 = allowedCharacters
> # 2 = disallowedCharacters
> filterWhatKind = 1
>
> # This flag specifies whether to allow filtering or not
> # true = allow filtering
> # false = disallow filtering
> filterFlag = true
>
> Have a method called filter() in the BeanUtils that will implement
the
> specific filter. Based on the 'filterFlag' value this method is either
> called or ignored in the BeanUtils.populate () method.
>
> The properties file is specified in the web.xml file at the
> ActionServlet level.
> This file is application specific and can be changed / modified based on
the
> application. Not having this properties file indicates that no filtering
is
> to be implemented.
>
> Any comments / suggestions are welcome.
>
> cheers,
> Amar..
>

(See attached file: TextFilter.java)
(See attached file: MappingParser.java)
(See attached file: character_mappings.xml)



RE: Tag to iterate a ResultSet

2001-05-23 Thread Nanduri, Amarnath

I believe taglibs has a tag which does this for you. Search Jakarta taglibs
and viola you got your tag.

cheers,
Amar..

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 7:08 AM
To: [EMAIL PROTECTED]
Subject: Tag to iterate a ResultSet


Hi,

I've only recently started looking at struts and as part of my play want to
produce an HTML table of a ResultSet. Are there any tags included to do
this (I can't find anything) - or has anyone else done this? In the
meantime I'll start writing my own I suppose. It will be agood learning
experience...

Regards,

Sean


-
Dr Sean Radford, MBBS, MSc
Senior Consultant
Agora Professional Services Ltd
[EMAIL PROTECTED]
http://www.agora.co.uk



Suggestions for Struts 1.1 TODO LIST ---- Request Filtering technology for Struts

2001-05-23 Thread Nanduri, Amarnath

Hi Everybody,

 I would really like the opinion of the big heavyweights who designed
this framework. I have a small but important suggestion to make for the
struts 1.1 todo list.
So far struts does not implement a filtering technology for incoming
requests which is very important in this hacker dominated world. I have a
simple solution / change that can be made to the current version of struts
which would implement this filtering technology. This filter basically
filters out unwanted characters submitted by the user so that the database
will not be harmed. I propose that the BeanUtils.populate() method be
modified to include a filter(before calling the setters on the corresponding
form object). The filter() method takes the bad / unwanted characters out
and give back a clean string. This clean string is then set in the
corresponding form setter method. This filter would read from a properties
file the following criteriaThe structure of the properties file would
be..

# allowed characters in the database
allowedCharacters = askbdsvASDASDA123412321...

# disallowed characters in the database
disallowedCharacters = ~`!@#$%^&*()-|\\<,>.?/:;"'
  
# replacement character. For every disallowed character in the input
string, 
# it would be replaced by this character
replacementChar = "-"

# This flag specifies whether to check the incoming string for
allowedCharacters 
# or disallowedCharacters. 
# 1 = allowedCharacters
# 2 = disallowedCharacters
filterWhatKind = 1

# This flag specifies whether to allow filtering or not
# true = allow filtering
# false = disallow filtering
filterFlag = true

Have a method called filter() in the BeanUtils that will implement the
specific filter. Based on the 'filterFlag' value this method is either
called or ignored in the BeanUtils.populate () method.

The properties file is specified in the web.xml file at the
ActionServlet level.
This file is application specific and can be changed / modified based on the
application. Not having this properties file indicates that no filtering is
to be implemented.

Any comments / suggestions are welcome.

cheers,
Amar..



RE: Permissions: read-only vs. writable version

2001-05-22 Thread Nanduri, Amarnath
Title: Referer pages and structs



Write 
your own tag which takes in as input a parameter,. It checks the permissions for 
that parameter and returns true or false.
 
cheers,
Amar..

  -Original Message-From: Shunhui Zhu 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, May 22, 2001 12:34 
  PMTo: [EMAIL PROTECTED]Subject: 
  Permissions: read-only vs. writable version
  Hi, I'm wondering 
  whether anyone knows of a solution, prefereably via tags, to the permission 
  problem. I have a page, but depending on the user, I'd like to present it as 
  either read-only, or as writable, this can even be on the field-by-field 
  level. For example, the price field, should either be presented as  for a writable version, or simply as text for a read-only 
  version. The not so pretty solution is to put all the  type 
  of tag around the fields, but I'd like to know whether there are other 
  solutions, such as put the logic in the  tags, or some other 
  way. 
   
  Thanks.
   
  Shunhui


image tag to submit information

2001-05-22 Thread Nanduri, Amarnath


Hi All ,

   For those of you out there who have used image buttons to submit
information, i have a problem which i am hoping you will help me with... 
I am using an image where onclick will let me open a new window with the new
information on it. The below html does this quite nicely. 




 Can anybody tell me how to use the struts  or  tag to
do this...Also i want the image to be an internationalized image. So i want
to specify my image location in the properties file. Anybody who has done
this before please share your solution. I have spend quite a lot of time
trying to crack this (without success) and this is upsetting my schedule.
Thanks a lot.

cheers,
Amar..



RE: New to Struts

2001-05-21 Thread Nanduri, Amarnath

Benefit ?Here are a few..

  Completely Internationalized
  Scalable
  Flexible

However if your app is already up and running  in deployment mode, i would
not suggest migrating it to struts cause that is  a costly process

cheers,
Amar..

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 4:56 PM
To: [EMAIL PROTECTED]
Subject: New to Struts


Hi,

I am new to struts and am going thru the documentation.  Had a very basic
question, If I have an application which is using MVC architecture and is
completely J2EE compliant what is the benefit of using Struts framework.

regards
-abhinav



hyperlink and popup window

2001-05-21 Thread Nanduri, Amarnath


Hi All,

I am using the  tag to generate a hyperlink . Can somebody
help me out with what i need to put in this tag to get the below output.
Thanks  alot.

information


Also will the sessionid information be generated along with the hyperlink ? 


cheers,
Amar..






RE: Iterate and Radio tags

2001-05-18 Thread Nanduri, Amarnath


If getChildGroupOID() is a method in  domainDomainRelationHolder then try
this


   

  
 
  
  
  
 
  
  
   


-Original Message-
From: B Manikandan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 2:30 PM
To: [EMAIL PROTECTED]
Subject: Re: Iterate and Radio tags


Hi Amar,
I have a problem in implementing this solution.
I have a situation similar to the user and subscription class scenarion of
struts-example.

I have a DomainHolder object which has a collection of
DomainDomainRelationHolder object as a Hashtable.

In my Domain.jsp I have to display the list of DomainDomainRelation objects.

I have the following iterate tag.

   

  
 
  
  
  
 
  
  
   


Iam  getting an exception saying that getChildGroupOID() is not found in
java.lang.Object.

In my DomainHolder object I have a property corresponding to
childGroupOID.But I
am not sure where to have a collection that returns the childGroupOID.
This is a problem since childGroupOID is a user entered value in my
DomainDomainRelationHolder and I need this value to retrieve the
corresponding
object from DomainHolder for Edit action.

This is the same situation as struts-example with one exception being that I
have to use radio buttons instead of links as in the example.

Mani

"Nanduri, Amarnath" wrote:

> Hi Mani,
>
>   Try this. It works for meIt is a hack i need to implement in my
> ActionForm also.
>
>   
> 
>
>   
>
> public class StatesBeanForm extends ActionForm
> {
>
>   // this has the corresponding getter and setter
>   private ArrayList  states = null ;
>
>
>   // a variable which has to store the value of the radio button selected
by
> the user. This also has a getter and setter
>
>   private  String selectedIndex  = null ;
>
>   // setters and getters
>   private  ArrayList indexedValue = null ;
>
> }
>
> -Original Message-
> From: B Manikandan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 16, 2001 3:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Iterate and Radio tags
> Importance: High
>
> Hi,
>   I have posted the same question,but did not get any reply.I need to set
> the
> value of radio button to a property from my bean.
>   And I need to do this in a iterate.
>
> Mani
>
> "Nanduri, Amarnath" wrote:
>
> > Hi All,
> >
> > I am using a Radio Button in an Iterate Tag. I would like to give a
> > unique id value to each and every radio button. The name of the button
> will
> > be the same but the value will be different. So if a user clicks ona
> > particular radio button, i will know which value is he looking for ? Is
> this
> > possible using the struts html:radio tag ? or do i need to use a
different
> > tag ?
> >
> > cheers,
> > Amar..



RE: Indexed Grid Representation on a Form

2001-05-17 Thread Nanduri, Amarnath



    <% int i = 0; 
%>       
 <% i++ ; 
%>    
   
    
 
 

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 17, 2001 3:58 
  PMTo: [EMAIL PROTECTED]Subject: Indexed 
  Grid Representation on a Form
  I think this should work (but obviously it 
  doesn't).  Can anyone tell me why?
   
      <% int i = 0; 
  %>       
      
     
      
   
  Where getCustomerContacts() returns a vector of 
  CustomerContact objects &
      getCustomerConact(int offset) 
  returns an CustomerContact element from that vector.
   
  thanks,
  jeff
   


RE: pager tag , iterate tag and displaying data as rows in a tabl e

2001-05-16 Thread Nanduri, Amarnath

You might want to look at Radio Button question discussion thread also..


-Original Message-
From: Sheikh, Jawwad [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 5:27 PM
To: '[EMAIL PROTECTED]'
Subject: RE: pager tag , iterate tag and displaying data as rows in a
tabl e


so how did you do it?

-Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 3:58 PM
To: '[EMAIL PROTECTED]'
Subject: RE: pager tag , iterate tag and displaying data as rows in a
table


Never mind. figured it out myself and it works just fine

cheers,
Amar..

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:30 PM
To: '[EMAIL PROTECTED]'
Subject: pager tag , iterate tag and displaying data as rows in a table



Hi All,

  I am using a pager tag that i got from jsptags.com 
I am using it in conjunction with the struts  logic:iterate tag to spit
out
a bunch of rows.

The question i have is.. Is it possible to get the index of the current
element in the iteration ? The reason for asking this is that i am using
a
unique index for every item in the row ( I am using a Radio Button for
this). When i page back and forth i want to make sure that the unique id
the
client is getting (for every row) is the index to the current element in
the
Collection. If i am paging forward, i should get rows in ascending
order,
and if i am paging backward i should get rows in descending order. 

Can anybody help me out here. Thanks  a lot.  

I am attaching some code (which is not working proplery) here which
should
give people some pointers


  

  

  




 
 


  

  




cheers,
Amar..



RE: pager tag , iterate tag and displaying data as rows in a tabl e

2001-05-16 Thread Nanduri, Amarnath

Look at my other posting Iterate and Radio tags. You should find it in the
mailing list .

cheers,
Amar..

-Original Message-
From: Sheikh, Jawwad [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 5:27 PM
To: '[EMAIL PROTECTED]'
Subject: RE: pager tag , iterate tag and displaying data as rows in a
tabl e


so how did you do it?

-Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 3:58 PM
To: '[EMAIL PROTECTED]'
Subject: RE: pager tag , iterate tag and displaying data as rows in a
table


Never mind. figured it out myself and it works just fine

cheers,
Amar..

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:30 PM
To: '[EMAIL PROTECTED]'
Subject: pager tag , iterate tag and displaying data as rows in a table



Hi All,

  I am using a pager tag that i got from jsptags.com 
I am using it in conjunction with the struts  logic:iterate tag to spit
out
a bunch of rows.

The question i have is.. Is it possible to get the index of the current
element in the iteration ? The reason for asking this is that i am using
a
unique index for every item in the row ( I am using a Radio Button for
this). When i page back and forth i want to make sure that the unique id
the
client is getting (for every row) is the index to the current element in
the
Collection. If i am paging forward, i should get rows in ascending
order,
and if i am paging backward i should get rows in descending order. 

Can anybody help me out here. Thanks  a lot.  

I am attaching some code (which is not working proplery) here which
should
give people some pointers


  

  

  




 
 


  

  




cheers,
Amar..



RE: Radio Button question

2001-05-16 Thread Nanduri, Amarnath

Also see an other posting i made in struts mailing list.. Iterate and Radio
tags and follow the thread. It is self explanatory.

cheers,
Amar..

-Original Message-
From: Shane Warne [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 4:08 PM
To: [EMAIL PROTECTED]
Subject: RE: Radio Button question


Amar,
The idea's good. But the radio button values have to
be set.
Like the dbase would hold the values for the radio
button or the check box and i have display the
disabled radio or checkbox depending on what value is
coming from the dbase.

We have the property in Struts, i'm not sure whether
it works or not ??
Please throw some light..

--Shane

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Radio Button question

2001-05-16 Thread Nanduri, Amarnath

Shane,
   
It works for me. The value in the Radio Button is dynamic. I am at
present setting an index for each Radio Button. When the user submits
information back, i know what index it is based on the value selected in the
Radio Button. I then lookup in the ArrayList on this index and get my
correct object to deal with my logic..

 In your case you are holding the values of the Radio Buttons inside the
database.
You might want to call a method with an index and the method will return the
value based on the index you send in. 

A brief example would be..

  <% int i = 0 ; %>
  

<% i++ ; %>
  

where the property is the actual value you are trying to compare and value
is got from the database...

This is not pretty but it serves the purpose whether it is a Radio button or
a Checkbox...Struts compares the property to the value. If both match then
the checkbox is checked, else the checkbox will not be selected... Hope this
helps. Took me a whole day to figure this out and get it working.

cheers,
Amar..





-Original Message-
From: Shane Warne [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 4:08 PM
To: [EMAIL PROTECTED]
Subject: RE: Radio Button question


Amar,
The idea's good. But the radio button values have to
be set.
Like the dbase would hold the values for the radio
button or the check box and i have display the
disabled radio or checkbox depending on what value is
coming from the dbase.

We have the property in Struts, i'm not sure whether
it works or not ??
Please throw some light..

--Shane

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Iterate and Radio tags

2001-05-16 Thread Nanduri, Amarnath

Hi Mani,
 
  Try this. It works for meIt is a hack i need to implement in my
ActionForm also.


  


  

public class StatesBeanForm extends ActionForm   
{

  // this has the corresponding getter and setter
  private ArrayList  states = null ;


  // a variable which has to store the value of the radio button selected by
the user. This also has a getter and setter

  private  String selectedIndex  = null ;

  // setters and getters
  private  ArrayList indexedValue = null ;

}




-Original Message-
From: B Manikandan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 3:05 PM
To: [EMAIL PROTECTED]
Subject: Re: Iterate and Radio tags
Importance: High


Hi,
  I have posted the same question,but did not get any reply.I need to set
the
value of radio button to a property from my bean.
  And I need to do this in a iterate.

Mani



"Nanduri, Amarnath" wrote:

> Hi All,
>
> I am using a Radio Button in an Iterate Tag. I would like to give a
> unique id value to each and every radio button. The name of the button
will
> be the same but the value will be different. So if a user clicks ona
> particular radio button, i will know which value is he looking for ? Is
this
> possible using the struts html:radio tag ? or do i need to use a different
> tag ?
>
> cheers,
> Amar..



RE: pager tag , iterate tag and displaying data as rows in a table

2001-05-16 Thread Nanduri, Amarnath

Never mind. figured it out myself and it works just fine

cheers,
Amar..

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:30 PM
To: '[EMAIL PROTECTED]'
Subject: pager tag , iterate tag and displaying data as rows in a table



Hi All,

  I am using a pager tag that i got from jsptags.com 
I am using it in conjunction with the struts  logic:iterate tag to spit out
a bunch of rows.

The question i have is.. Is it possible to get the index of the current
element in the iteration ? The reason for asking this is that i am using a
unique index for every item in the row ( I am using a Radio Button for
this). When i page back and forth i want to make sure that the unique id the
client is getting (for every row) is the index to the current element in the
Collection. If i am paging forward, i should get rows in ascending order,
and if i am paging backward i should get rows in descending order. 

Can anybody help me out here. Thanks  a lot.  

I am attaching some code (which is not working proplery) here which should
give people some pointers


  

  

  




 
 


  

  




cheers,
Amar..



pager tag , iterate tag and displaying data as rows in a table

2001-05-16 Thread Nanduri, Amarnath


Hi All,

  I am using a pager tag that i got from jsptags.com 
I am using it in conjunction with the struts  logic:iterate tag to spit out
a bunch of rows.

The question i have is.. Is it possible to get the index of the current
element in the iteration ? The reason for asking this is that i am using a
unique index for every item in the row ( I am using a Radio Button for
this). When i page back and forth i want to make sure that the unique id the
client is getting (for every row) is the index to the current element in the
Collection. If i am paging forward, i should get rows in ascending order,
and if i am paging backward i should get rows in descending order. 

Can anybody help me out here. Thanks  a lot.  

I am attaching some code (which is not working proplery) here which should
give people some pointers


  

  

  




 
 


  

  




cheers,
Amar..



RE: Iterate and Radio tags

2001-05-16 Thread Nanduri, Amarnath

Jawwad,

 Thank you for your help. 

cheers,
Amar..

-Original Message-
From: Sheikh, Jawwad [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 12:48 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Iterate and Radio tags


Amar

I had a situation where I was using a 'for' loop instead of the
iterate tag. So to assign a unique value, this what I did.

 

where 'i' is the loop counter.

Hope this helps.

Jawwad

-----Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 10:31 AM
To: '[EMAIL PROTECTED]'
Subject: Iterate and Radio tags


Hi All,

I am using a Radio Button in an Iterate Tag. I would like to give a
unique id value to each and every radio button. The name of the button
will
be the same but the value will be different. So if a user clicks ona
particular radio button, i will know which value is he looking for ? Is
this
possible using the struts html:radio tag ? or do i need to use a
different
tag ?

cheers,
Amar..



RE: page flow control

2001-05-16 Thread Nanduri, Amarnath

Write a flow controller which does this. Look at the pet-store example app
for inspiration.

cheers,
Amar..

-Original Message-
From: Nathan Coast [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 10:09 AM
To: struts-user
Subject: page flow control


Hi,

In the site I'm developing, there are sections that have forms on
consecutive 
pages, I want to guarantee that pages are navigated: page1 -> page2 ->
pageN. 
At the same time allowing back and forward navigation to change values
entered 
on previous pages.  After the last submit, the only valid page in the
sequence 
is then page1.  I've had a look at the Struts Token functionality but I
don't 
think it can support this functionality.  Is it possible with Tokens or some

other way?

Thanks in advance
Nathan



Iterate and Radio tags

2001-05-16 Thread Nanduri, Amarnath

Hi All,

I am using a Radio Button in an Iterate Tag. I would like to give a
unique id value to each and every radio button. The name of the button will
be the same but the value will be different. So if a user clicks ona
particular radio button, i will know which value is he looking for ? Is this
possible using the struts html:radio tag ? or do i need to use a different
tag ?

cheers,
Amar..



RE: Radio Button question

2001-05-16 Thread Nanduri, Amarnath

Hi Shane ,

   you can doa  small hack . Have a Radio Button / Checkbox image. In your
iterate tag use the logic:equal tag to find out if it is read only. If read
only flag is true, show the image else show the Radio Button. Hope this
helps.

cheers,
Amar..


-Original Message-
From: Shane Warne [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 9:30 AM
To: [EMAIL PROTECTED]
Subject: Re: Radio Button question


Amar,
I was looking for a similar solution too. I was
wondering how do i disable a radio button/ check box
when the page to be displayed is just read only..
I can use the normal form elements to get the job done
but is it possible using Struts???


Shane..

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Design Suggestion

2001-05-16 Thread Nanduri, Amarnath

Tony,

   Yeah. The question that is in my mind is  How big a change is this
going to be ? Does the whole framework needs to be re-visited inorder to
make this change ? Maybe the experts out there can suggest / turndown what
we were discussing 

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 9:13 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


Amarnath,

I like your proposal for backward compatibility.  However, just to make sure
there is no misunderstanding, you are proposing that a new interface (e.g.,
FormInterface) be introduced into struts which defines something similar to
the current interface of ActionForm.  ActionForm would be modified to
implement the interface.  All references to ActionForm in the struts
framework would be changed to the new interface.

Tony


-Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 2:08 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


Hi Tony,
 
  I get your point. Instead of making the ActionForm an interface (which is
too difficult to do right now because a lot of projects are there in the
works and deployment in which all the forms extend ActionForm). All these
projects will not be compatible with new versions of the Struts framework. 

  Instead i would like to propose that ActionForm implement FormInterface
with maybe stubbedout method calls (if needed). That way the future
revisions of Framework would still be backward compatible with projects that
were already deployed. Future projects can either extend the ActionForm (or)
implement the FormInterface. That way if struts has to support anything out
there ( like WAP or XML or SOAP or whatever comes in the future) it can do
so via this interface (or add new interfaces to the existing ActionForm).
Any votes /comments /suggestions on this one ?

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 11:41 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


But I won't be able to have a reference of type ABCInterface that knows it
is of type ActionForm.

The primary intent of my original message was to suggest that ActionForm be
an interface and a basic implementation (e.g., BasicActionForm) be provided.
In my opinion this would be a simple change and allow extension of the
ActionForm using interfaces as well as inheritance.


Consider the following example:

class A
class B extends A
class C extends B
class D extends C

X extends A

M would like to extend both X and C.  With inheritance this is a problem.
With interfaces there are more options.  
Change the above example to use interface rather than class and assume that
letter' implements letter interface (i.e., A' implements A interface).  

interface A   class A' implements A
interface B extends A class B' implements B
interface C extends B class C' implements C
interface D extends C class D' implements D

interface X extends A class X' implements X

The implementer of M could choose to extend C' and implement X interface or
extend X' and implement the B and C interfaces.  Any reference (e.g., A, B,
C, X, or M) would know that the object was an instance of type A.

Cheers,

Tony


-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:06 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion



Yes. Now try this.

  public  abstract BaseActionForm extends ActionForm inplements ABCInterface
, DEFInterface

  This will let you implement as many interfaces as you want...

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 8:55 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


My version of the code has:


public abstract class ActionForm implements Serializable {

The only interface ActionForm implements is Serializable.

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 1:51 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion



What you can do is try to create a BaseActionForm which extends ActionForm
and implements some interface (like FormInterface or something). This should
solve your problem. 

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 12:38 PM
To: '[EMAIL PROTECTED]'
Subject: Design Suggestion


I have a situation where it would be useful if the ActionForm was an
interface rather than an abstract class.  Basically, I had developed some
subclasses of ActionForm that I found useful.  I am now integrating with
another developer who also has useful subclasses of ActionForms.
Unfortunately the implementations

RE: html:link with local forward

2001-05-15 Thread Nanduri, Amarnath

Yeah. Let the link hit an Action class with the forward as a name=value
pair. All the Action will do is forward the user to the corresponding page
(based on the value in the name=value pair).

cheers,
Amar..

-Original Message-
From: Greg Ritter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 2:20 PM
To: '[EMAIL PROTECTED]'
Subject: html:link with local forward


I have a template that I use to generate my pages, that includes a title
bar with a close button on each page:

...

...

I would like to be able to specify a local forward for each action in
struts-config.xml:

...

  
  

...

However, the forward that can be specified in  can only be a
global forward.

Does anyone have any suggestions on an elegant way to do something
similar to this?

-Greg-



Radio Button question

2001-05-15 Thread Nanduri, Amarnath

Hi All,

  Is it possible to set the value of a Radio Button at runtime ? I have
an Iterator in my ActionForm containing a list of users.
I have to show this list of users to the client. When the client selects on
a particular user (aka radio button), and submits the form, i want to set
the value in a particular field in the ActionForm. Any suggestions ? I would
really appreciate some code if anybody has done something like
this...nothing too sophisticated just some simple required lines of code.
Thanks..

cheers,
Amar..



RE: Design Suggestion

2001-05-15 Thread Nanduri, Amarnath

Hi Tony,
 
  I get your point. Instead of making the ActionForm an interface (which is
too difficult to do right now because a lot of projects are there in the
works and deployment in which all the forms extend ActionForm). All these
projects will not be compatible with new versions of the Struts framework. 

  Instead i would like to propose that ActionForm implement FormInterface
with maybe stubbedout method calls (if needed). That way the future
revisions of Framework would still be backward compatible with projects that
were already deployed. Future projects can either extend the ActionForm (or)
implement the FormInterface. That way if struts has to support anything out
there ( like WAP or XML or SOAP or whatever comes in the future) it can do
so via this interface (or add new interfaces to the existing ActionForm).
Any votes /comments /suggestions on this one ?

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 11:41 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


But I won't be able to have a reference of type ABCInterface that knows it
is of type ActionForm.

The primary intent of my original message was to suggest that ActionForm be
an interface and a basic implementation (e.g., BasicActionForm) be provided.
In my opinion this would be a simple change and allow extension of the
ActionForm using interfaces as well as inheritance.


Consider the following example:

class A
class B extends A
class C extends B
class D extends C

X extends A

M would like to extend both X and C.  With inheritance this is a problem.
With interfaces there are more options.  
Change the above example to use interface rather than class and assume that
letter' implements letter interface (i.e., A' implements A interface).  

interface A   class A' implements A
interface B extends A class B' implements B
interface C extends B class C' implements C
interface D extends C class D' implements D

interface X extends A class X' implements X

The implementer of M could choose to extend C' and implement X interface or
extend X' and implement the B and C interfaces.  Any reference (e.g., A, B,
C, X, or M) would know that the object was an instance of type A.

Cheers,

Tony


-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:06 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion



Yes. Now try this.

  public  abstract BaseActionForm extends ActionForm inplements ABCInterface
, DEFInterface

  This will let you implement as many interfaces as you want...

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 8:55 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


My version of the code has:


public abstract class ActionForm implements Serializable {

The only interface ActionForm implements is Serializable.

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 1:51 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion



What you can do is try to create a BaseActionForm which extends ActionForm
and implements some interface (like FormInterface or something). This should
solve your problem. 

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 12:38 PM
To: '[EMAIL PROTECTED]'
Subject: Design Suggestion


I have a situation where it would be useful if the ActionForm was an
interface rather than an abstract class.  Basically, I had developed some
subclasses of ActionForm that I found useful.  I am now integrating with
another developer who also has useful subclasses of ActionForms.
Unfortunately the implementations are orthogonal.  They create a situation
that could be solved with multiple inheritance.  Since multiple inheritance
is neither supported nor desired, the best solution involves the ability to
extend ActionForm with interfaces rather than through inheritance.

Does anyone know why the ActionForm should not be defined as an interface
with a BasicActionForm providing the current implementation?

Would anyone care to caution me on making this change within my own version
of struts?



RE: Caching Problem

2001-05-15 Thread Nanduri, Amarnath


In your web.xml file set the following ...

  
action
org.apache.struts.action.ActionServlet

  application
  ApplicationResources


  config
  /WEB-INF/struts-config.xml


  validate
  true


  nocache
  true

  


-Original Message-
From: Dinesh Chaturvedi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:02 AM
To: [EMAIL PROTECTED]
Subject: Caching Problem



Hello Every body

I am facing a problem ,i want  My JSP Page not
to take content from chache can anybody help me.
Thanks & Regards

Dinesh Chaturvedi
Programmer Analyst 
Nihilent Technologies Pvt Ltd.
Pune 091-20-6054452 Ext 349






RE: Hidding .jsp files

2001-05-15 Thread Nanduri, Amarnath

Will this in anyway affect the mapping in the struts-config.xml file ?


-Original Message-
From: Scott Walter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:00 AM
To: [EMAIL PROTECTED]
Subject: Re: Hidding .jsp files


Look into the web.xml file.  Since a JSP page is a
servlet, you can setup a  tag for the JSP
page (instead of specifiying servlet-class, use
jsp-file).  You will then create a 
to specify the url to listen on.

scott.
--- Mikkel Bruun <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> 
> Is it possible to make some sort of virtual path,
> enabling one to hide the
> actual .jsp pages???
> 
> Example,
> 
> i want to avoid a link like /logon/logonform.jsp
> replacing it with perhaps /logon (which in turn will
> point to
> /logon/logonform.jsp)
> 
> I tried looking at the globalforwards, but i find
> the documentation quite
> lacking (there's an error in the code, btw)...but is
> this how its done???
> 
> Another solution would be to make "empty" action
> classes that just returns
> the succes mapping, but that would be going over the
> top imho...
> 
> 
> Can anybody give an answer???
> 
> thanks
> Mikkel Bruun
> 
> 


=
~~~
Scott

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Design Suggestion

2001-05-15 Thread Nanduri, Amarnath


Yes. Now try this.

  public  abstract BaseActionForm extends ActionForm inplements ABCInterface
, DEFInterface

  This will let you implement as many interfaces as you want...

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 8:55 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion


My version of the code has:


public abstract class ActionForm implements Serializable {

The only interface ActionForm implements is Serializable.

-Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 1:51 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Design Suggestion



What you can do is try to create a BaseActionForm which extends ActionForm
and implements some interface (like FormInterface or something). This should
solve your problem. 

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 12:38 PM
To: '[EMAIL PROTECTED]'
Subject: Design Suggestion


I have a situation where it would be useful if the ActionForm was an
interface rather than an abstract class.  Basically, I had developed some
subclasses of ActionForm that I found useful.  I am now integrating with
another developer who also has useful subclasses of ActionForms.
Unfortunately the implementations are orthogonal.  They create a situation
that could be solved with multiple inheritance.  Since multiple inheritance
is neither supported nor desired, the best solution involves the ability to
extend ActionForm with interfaces rather than through inheritance.

Does anyone know why the ActionForm should not be defined as an interface
with a BasicActionForm providing the current implementation?

Would anyone care to caution me on making this change within my own version
of struts?



RE: a small problem

2001-05-14 Thread Nanduri, Amarnath



Make 
sure that you rApplicationResources.properties is in the 
classpath
 
cheers,
Amar..

  -Original Message-From: Tong, Tom 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, May 14, 2001 4:03 
  PMTo: '[EMAIL PROTECTED]'Subject: a small 
  problem
  
  Hello,
   
  I am 
  new to Struts and just trying to use validate() function. I followed the 
  struts-example and made my validation implementation. My validation is working 
  (I can’t leave my page if I gave an invalided input), however, I can’t get the 
  error message showing. Of course I have my messages in my 
  ApplicationResources.property file.
   
  Is 
  there anyone can give me some hints to find out my problem? 
  
   
  Great 
  thanks in advance,
   
  Tom


RE: Design Suggestion

2001-05-14 Thread Nanduri, Amarnath


What you can do is try to create a BaseActionForm which extends ActionForm
and implements some interface (like FormInterface or something). This should
solve your problem. 

cheers,
Amar..

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 12:38 PM
To: '[EMAIL PROTECTED]'
Subject: Design Suggestion


I have a situation where it would be useful if the ActionForm was an
interface rather than an abstract class.  Basically, I had developed some
subclasses of ActionForm that I found useful.  I am now integrating with
another developer who also has useful subclasses of ActionForms.
Unfortunately the implementations are orthogonal.  They create a situation
that could be solved with multiple inheritance.  Since multiple inheritance
is neither supported nor desired, the best solution involves the ability to
extend ActionForm with interfaces rather than through inheritance.

Does anyone know why the ActionForm should not be defined as an interface
with a BasicActionForm providing the current implementation?

Would anyone care to caution me on making this change within my own version
of struts?



RE: Urgent help needed

2001-05-14 Thread Nanduri, Amarnath

Hello Sudhir,

   I will try my best. All the examples that come with the struts 1.0
beta download are in the form of war files. According to the sun specs, a
war file is a self-contained web archive repository. It means all the info
required to run that application resides in that war itself. So you can take
a war running on a webserver and drop it in an other webserver, and it would
run seamlessly without any hiccups.
If you want to get to the structure of the war file, use winzip on the war
file and you will get the directory structure as to how the war file is
organized. On Tomcat there is a directory called webapps. Drop your war
files in there and when you restart tomcat it will automatically pickup the
app and load it. If you are facing problems, then it is a configuration
issue with your webserver.

There is also documentation on struts (it comes with the download). This is
an excellent starting point to learn struts. 
An other good site to visit is  http://www.husted.com/about/struts/ . There
you will find excellent resources on struts. Hope this helps.

cheers,
Amar..

-Original Message-
From: Sudhir M [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 12:52 AM
To: [EMAIL PROTECTED]
Subject: Urgent help needed


Hi Amarnath 

I am absolutely new to STRUTS and i have just downloaded the
Examples from the net. Can u please help me in running the same. I mean,
where excatly to place the jar files and what all other setttings are
required. Please!

Thanks 
Sudhir 

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 12, 2001 2:07 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Urgent help needed


Try this

  Keep the struts.jar file in the tomcat\lib directory and see it that
helps.



-Original Message-
From: Vinod Shintre [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 2:46 PM
To: [EMAIL PROTECTED]
Subject: Urgent help needed


can some1 tell me why am i getting this error & possible solution
---
Internal Servlet Error:

org.apache.jasper.compiler.CompileException:
/home/vshintre/jakarta/jakarta-tomcat-3.2.1/webapps/struts-blank/login.jsp(3
,2)
Unable to load class org.apache.struts.taglib.html.FormTag
at
org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:129
)

---

thanx in advance

vin

***Confidential Notice

This e-mail communication may contain information that is
confidential and privileged. The information is intended
to be for the use of the addressee only. If you are not the
named addressee you should not disseminate, distribute or
copy this e-mail: to do so could be a breach of confidence.

Kshema Technologies Ltd.,
# 33/1, Lalbagh Road, Bangalore 560027, INDIA. 
Tel: (91) 80- 2995114/5/6
Fax: (91) 80 2272933 

**



RE: Passing request to a common action class from multiple forms

2001-05-14 Thread Nanduri, Amarnath


Hmmm. things will become very simple if you use multiple Action Classes
that extend your base Action class.
In your struts-config.xml you can then map an individual form for each
action class. Even though all Action Classes 
perform almost the same business logic, you might want to put this common
business logic in the superclass and let the sublclasses
take care of some other stuff. In this way your jsp pages can then call the
separate Action classes, passing in different forms and you
take care of that info in the separate action classes.

cheers,
Amar..

-Original Message-
From: B Manikandan [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 13, 2001 6:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Passing request to a common action class from multiple
forms


Hi,
   When a form object is not associated with the action class,ActionServlet
passes null as formInstance.
   I need to have access to the form that called my common action class,so
that
I can set some value in that form and return it back to the caller.

How to do this ?

Mani


"Nanduri, Amarnath" wrote:

> Hi Mani,
>
> If different forms are posting information to the same Action
class
> there are a couple of steps you need to do...
>
> 1. In your struts-config.xml file where you are declaring your action
class,
> don't associate a form to this Action class.
>
> 2. I assume that since multiple forms are submitting to the same action
> class, each form is associated with its own jsp page. i.e A bunch of jsp
> pages, each having its own ActionForm submit to the same Action class. In
> that case in the  tag in your jsp page, write the form name. So
> every jsp page will have its own unique form object, all submitting to the
> same action. These forms are declared in the struts-config.xml file. You
> should take care not to associate these form classes to your single action
> class as mentioned in the previous step.
>
> 3. In your Action class, you might want to set the form bean to either
> request, session or page scope depending on your requirements.
>
> 4. Something you might want to consider is using inheritance on your
> ActionForms (if they contain almost same values).
>
> Hope this helps
>
> cheers,
> Amar..
>
> -Original Message-
> From: B Manikandan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 10:06 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Passing request to a common action class from multiple
> forms
>
>I have a domain.jsp which has a button on click of which action is
> forwarded
> to an action class which displays cascade.jsp.
> In cascade.jsp the objects displayed are same even though their values
> may
> be different.User can select some values and these values have to be
passed
> back
> to input.jsp.
> The reason for the common action class is because,the functionality is
> same
> for all forms which have to call cascade.jsp.The variables to be selected
> from
> cascade.jsp (oid and name) is always same,even though their values may be
> different.
>
> How to get input from different forms and pass it back to the callee form.
>
> If it sounds "spaghetti" is there a better way of implementing it.
>
> Mani
>
> "Nanduri, Amarnath" wrote:
>
> > Can yo be more detailed ? All i gather sofar from your requirements is
> that
> > your company is planning to implement some spaghetti code (no offense
> meant)
> > using struts while everybody is trying to run away from it.
> >
> > cheers,
> > Amar..
> >
> > -Original Message-
> > From: B Manikandan [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 11, 2001 9:25 AM
> > To: struts
> > Subject: Passing request to a common action class from multiple forms
> >
> > Hi,
> >I have a common Action class,which will receive request from multiple
> > forms.
> >
> > This action class will then forward request to a common jsp and on
> > selection of a value from this jsp,the value has to be set in the input
> > form(which called the common action class).
> >
> > Then,request has to be forwarded to the input form.
> >
> > How to do this ?
> >
> > Mani



RE: will 2 submit buttons work?

2001-05-12 Thread Nanduri, Amarnath



It is 
legal as long as the value of the SUBMIT buttons are not internationalized. 

 
If 
your app is an internationalized app, then it will not work. In sucha  case 
you need to give different names to your SUBMIT buttons.
 
cheers,
Amar..

  -Original Message-From: Jonathan 
  [mailto:[EMAIL PROTECTED]]Sent: Saturday, May 12, 2001 11:10 
  AMTo: [EMAIL PROTECTED]Subject: will 2 
  submit buttons work?
  I have 2 submit inputs with one form.  both 
  have name="RESULT" but different values.  Is this legal?
   


RE: Form Reset

2001-05-12 Thread Nanduri, Amarnath

Search the struts mailing list archives for the keyword 'dirty flag'.
You will get a possible solution

cheers,
Amar..


-Original Message-
From: Tharwat Abdul-Malik [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 12, 2001 10:59 AM
To: [EMAIL PROTECTED]
Subject: Re: Form Reset


In your reset method include a condition where the values are only reset on
the last page of the form.
- Original Message -
From: "Michael Binette" <[EMAIL PROTECTED]>
To: "Struts-User" <[EMAIL PROTECTED]>
Sent: Saturday, May 12, 2001 8:20 AM
Subject: Form Reset


> The documentation mentions using one form bean to handle multiple forms
such
> as when you have a wizard type of user interface that spreads the form's
> fields over various pages.
>
> But, everytime the next page is called, ActionServlet.processPopulate
calls
> the form beans reset method and then copies in the form's fields.
>
> How is it possible to keep existing fields already filled in?  Or, am I
> supposed to copy the fields I need to keep in the Action class and then
move
> to the next view?
>
> --
> Thanks,
> Michael Binette
>
>



RE: Urgent help needed

2001-05-11 Thread Nanduri, Amarnath

Try this

  Keep the struts.jar file in the tomcat\lib directory and see it that
helps.



-Original Message-
From: Vinod Shintre [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 2:46 PM
To: [EMAIL PROTECTED]
Subject: Urgent help needed


can some1 tell me why am i getting this error & possible solution
---
Internal Servlet Error:

org.apache.jasper.compiler.CompileException:
/home/vshintre/jakarta/jakarta-tomcat-3.2.1/webapps/struts-blank/login.jsp(3
,2)
Unable to load class org.apache.struts.taglib.html.FormTag
at
org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:129
)

---

thanx in advance

vin





RE: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)

2001-05-11 Thread Nanduri, Amarnath

Its opensource. you can always modify it for your needs.

cheers,
Amar..

-Original Message-
From: Johan Compagner [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 1:45 PM
To: [EMAIL PROTECTED]
Subject: Re: Constants.TOKEN_KEY value proposed change (doesn't work
with javascript!!)


It would be nicer to have a name for this that is a bit better suited for
javascript!

johan

- Original Message - 
From: "David Winterfeldt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 5:56 PM
Subject: Re: Constants.TOKEN_KEY value proposed change (doesn't work with
javascript!!)


> You can do this.
> 
> document.nextpage["org.apache.struts.taglib.html.TOKEN"].value=themakey;
> 
> David
> 
> --- Johan Compagner <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > I use the token_key for transaction support.
> > But the value of the TOKEN_KEY =
> > org.apache.struts.taglib.html.TOKEN
> > 
> > This is a very odd value to have as a hidden input
> > field on your form.
> > Which is generated by the FormTag:
> >  > name="org.apache.struts.taglib.html.TOKEN"
> > value="">
> > 
> > Because you want to use that hidden field in some
> > javascript:
> > function submitNextpage(themakey)
> > {
> > 
> >
> document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
> > document.nextpage.submit();
> > }
> > 
> > You get a javascript error!
> > Because javascript sees all names between points as
> > an object.
> > 
> > Please change the TOKEN_KEY value in "TOKEN_KEY" or
> > something like that!!
> > 
> > Johan Compagner
> > 
> > 
> > 
> > 
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/



RE: filtering unwanted characters

2001-05-11 Thread Nanduri, Amarnath

I have to check each and every character send as input by the user...Will
SAX help me in this regard ?

cheers,
Amar..

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 12:19 PM
To: [EMAIL PROTECTED]
Subject: Re: filtering unwanted characters


try a sax parser

- Original Message -
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 8:35 AM
Subject: filtering unwanted characters


>
> Hi all,
>
>  I might be posting this message in the wrong forum. My apologies if i
> have offended anyone.
>
> I am looking for some open source code that deals with filtering
> technology. Basically i want to filter any unwanted characters from the
user
> input data. The user might try to pass in some SQL quesries or try to run
> some shell scripts or put special characters which might be rejected by a
> database (or even corrupt it). If no such open source code is available
then
> i want to write something like that. I was wondering if anyone has done
some
> thing like this in the past and if so, can they share their experiences ?
> Also is there any place i can search for some 'searching algorithms' which
i
> plan to use as the backbone of my filters that i plan to implement. Thank
> you very much.
>
> p.s We are using struts bigtime to develop a huge internationalized
project.
> So far it didn't let us down.
>
> cheers,
> Amar..
>



RE: Error handling with taglibs

2001-05-11 Thread Nanduri, Amarnath



You 
need to hack in...and do some dirty work on each jsp page...
 
You 
need to write your own  tag . Whenever there are some errors 
to be shown, you simply use some javascript to send focus to the first error 
field. Also in your jsp page (for evey text field) you might want to do 
something like an   if,else condition.. If no error show plain, else 
show in red font with the error msg. Hope this helps.
 
cheers,
Amar..

  -Original Message-From: Mike Prader 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, May 11, 2001 10:13 
  AMTo: [EMAIL PROTECTED]Subject: Error 
  handling with taglibs
  Hi all
   
  My problem is, that I want to mark a textfield 
  red and set the focus
  to it after I checked the fields in my from the 
  Action Class derived class and I detected an
  error in this input.
  I want to use taglibs also.
   
  Is there any possibility to do this in my from 
  the ActionForm Class derived class, so that Struts will
  automatically set this field to another colour 
  and set the focus to it ? If not 
  what is
  the best solution to mark the attribute in 
  my from the ActionForm Class derived Class that this field
  isn't ok ?
   
  regards
   
  mike


RE: Passing request to a common action class from multiple forms

2001-05-11 Thread Nanduri, Amarnath

Hi Mani,

If different forms are posting information to the same Action class
there are a couple of steps you need to do...

1. In your struts-config.xml file where you are declaring your action class,
don't associate a form to this Action class.

2. I assume that since multiple forms are submitting to the same action
class, each form is associated with its own jsp page. i.e A bunch of jsp
pages, each having its own ActionForm submit to the same Action class. In
that case in the  tag in your jsp page, write the form name. So
every jsp page will have its own unique form object, all submitting to the
same action. These forms are declared in the struts-config.xml file. You
should take care not to associate these form classes to your single action
class as mentioned in the previous step.

3. In your Action class, you might want to set the form bean to either
request, session or page scope depending on your requirements. 

4. Something you might want to consider is using inheritance on your
ActionForms (if they contain almost same values).

Hope this helps

cheers,
Amar..


-Original Message-
From: B Manikandan [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 10:06 AM
To: [EMAIL PROTECTED]
Subject: Re: Passing request to a common action class from multiple
forms


   I have a domain.jsp which has a button on click of which action is
forwarded
to an action class which displays cascade.jsp.
In cascade.jsp the objects displayed are same even though their values
may
be different.User can select some values and these values have to be passed
back
to input.jsp.
The reason for the common action class is because,the functionality is
same
for all forms which have to call cascade.jsp.The variables to be selected
from
cascade.jsp (oid and name) is always same,even though their values may be
different.

How to get input from different forms and pass it back to the callee form.

If it sounds "spaghetti" is there a better way of implementing it.

Mani



"Nanduri, Amarnath" wrote:

> Can yo be more detailed ? All i gather sofar from your requirements is
that
> your company is planning to implement some spaghetti code (no offense
meant)
> using struts while everybody is trying to run away from it.
>
> cheers,
> Amar..
>
> -Original Message-
> From: B Manikandan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 9:25 AM
> To: struts
> Subject: Passing request to a common action class from multiple forms
>
> Hi,
>I have a common Action class,which will receive request from multiple
> forms.
>
> This action class will then forward request to a common jsp and on
> selection of a value from this jsp,the value has to be set in the input
> form(which called the common action class).
>
> Then,request has to be forwarded to the input form.
>
> How to do this ?
>
> Mani



RE: Passing request to a common action class from multiple forms

2001-05-11 Thread Nanduri, Amarnath

Can yo be more detailed ? All i gather sofar from your requirements is that
your company is planning to implement some spaghetti code (no offense meant)
using struts while everybody is trying to run away from it.


cheers,
Amar..


-Original Message-
From: B Manikandan [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 9:25 AM
To: struts
Subject: Passing request to a common action class from multiple forms


Hi,
   I have a common Action class,which will receive request from multiple
forms.

This action class will then forward request to a common jsp and on
selection of a value from this jsp,the value has to be set in the input
form(which called the common action class).

Then,request has to be forwarded to the input form.

How to do this ?

Mani



RE: nanduri can u help ??ApplicationResources.properties

2001-05-11 Thread Nanduri, Amarnath

Hello Amit,

 In your web.xml file, when you declare the ActionServlet there is a
place where you specify the fully qualified path to the
ApplicationResource.properties file. Check that out. 

  
action
org.apache.struts.action.ActionServlet

  application
  com.agilquest.onboard.ApplicationResources

..

Note : if your ApplicationResource.properties file is not in a package then
make sure that you put it under the "classes" directory. 

If you are using a war file for deployment make sure that you follow the
proper directory structure for creating a war file.

Any more questions give a shout. Also _tmp_war file should not be tampered
with cause weblogic creates a new one whenever you restart it.


cheers,
Amar..




-Original Message-
From: Amit Jain [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 9:07 AM
To: [EMAIL PROTECTED]
Subject: nanduri can u help ??ApplicationResources.properties



My weblogic is complaining of ApplicationResources.properties file not
found..
I copied it to the _tmp_war** directory manually and when i restart it
creates a new _tmp_war** directory..so can't help

any solutions please.

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 1:35 PM
To: '[EMAIL PROTECTED]'
Subject: filtering unwanted characters



Hi all,

 I might be posting this message in the wrong forum. My apologies if i
have offended anyone.

I am looking for some open source code that deals with filtering
technology. Basically i want to filter any unwanted characters from the user
input data. The user might try to pass in some SQL quesries or try to run
some shell scripts or put special characters which might be rejected by a
database (or even corrupt it). If no such open source code is available then
i want to write something like that. I was wondering if anyone has done some
thing like this in the past and if so, can they share their experiences ?
Also is there any place i can search for some 'searching algorithms' which i
plan to use as the backbone of my filters that i plan to implement. Thank
you very much.

p.s We are using struts bigtime to develop a huge internationalized project.
So far it didn't let us down.

cheers,
Amar..


Legal Disclaimer:-

Please be aware that messages sent over the Internet may not 
be secure and should not be seen as forming a legally binding
contract unless otherwise stated.



filtering unwanted characters

2001-05-11 Thread Nanduri, Amarnath


Hi all,

 I might be posting this message in the wrong forum. My apologies if i
have offended anyone.

I am looking for some open source code that deals with filtering
technology. Basically i want to filter any unwanted characters from the user
input data. The user might try to pass in some SQL quesries or try to run
some shell scripts or put special characters which might be rejected by a
database (or even corrupt it). If no such open source code is available then
i want to write something like that. I was wondering if anyone has done some
thing like this in the past and if so, can they share their experiences ?
Also is there any place i can search for some 'searching algorithms' which i
plan to use as the backbone of my filters that i plan to implement. Thank
you very much.

p.s We are using struts bigtime to develop a huge internationalized project.
So far it didn't let us down.

cheers,
Amar..



RE: how to forward from one action servlet to another?

2001-05-10 Thread Nanduri, Amarnath

Nope the thread after invoking perform() will then decide what to do
next. Since you are already making its decision, it won't complain and will
die gracefully. 
An other way to do it is already pointed out by other people. In your
struts-config.xml file map the forward to a different servlet

One thing you might want to consider ...
If you are using a web application (war file or ear file) you have to
declare all your servlets in the web.xml file.

cheers,
Amar..




-Original Message-
From: Rajan Gupta [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 3:45 PM
To: [EMAIL PROTECTED]
Subject: RE: how to forward from one action servlet to another?


Will this not keep the thread of ActionServlet which invoked perform()
method hanging?
--- "Nanduri, Amarnath" <[EMAIL PROTECTED]> wrote:
> If you are using just Struts, then you have only one servlet, the
> ActionServlet.
> If you are using struts in conjunction with some other servlets, then in
> your action class do this...
> 
> public class XYZAction extends Action
> {
> 
>   public  ActionForward  perform(mapping, form, request, response)
>   {
> 
> request.setAttribute("form", form) ;
> 
>
> servlet.getServletConfig().getServletContext().getRequestDispacher("path
> to the other servlet").forward(request,response) ;
> 
>   }
> 
> }
> 
> -Original Message-
> From: Alex Colic [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 2:29 PM
> To: Struts
> Subject: how to forward from one action servlet to another?
> 
> 
> Hi,
> 
> how do you  forward from one action servlet to another? I have a form
> that
> gets submitted to a servlet that I may depending on a value pass it off
> to
> another servlet to process.
> 
> Any help is appreciated.
> 
> Alex
> 
>  ext. 104
> Fax: 1-905-777-0132


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: how to forward from one action servlet to another?

2001-05-10 Thread Nanduri, Amarnath

If you are using just Struts, then you have only one servlet, the
ActionServlet.
If you are using struts in conjunction with some other servlets, then in
your action class do this...

public class XYZAction extends Action
{

  public  ActionForward  perform(mapping, form, request, response)
  {

request.setAttribute("form", form) ;

servlet.getServletConfig().getServletContext().getRequestDispacher("path
to the other servlet").forward(request,response) ;

  }

}

-Original Message-
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 2:29 PM
To: Struts
Subject: how to forward from one action servlet to another?


Hi,

how do you  forward from one action servlet to another? I have a form that
gets submitted to a servlet that I may depending on a value pass it off to
another servlet to process.

Any help is appreciated.

Alex

 ext. 104
Fax: 1-905-777-0132



RE: Quick Iterate Question - DefaultTableModel

2001-05-10 Thread Nanduri, Amarnath

I think the taglibs have a tag that does something like this..

Amar..

-Original Message-
From: Assenza, Chris [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 12:56 PM
To: '[EMAIL PROTECTED]'
Subject: Quick Iterate Question - DefaultTableModel


Here's a quick one - anyone use or modify iterate to support iterations
through a DefaultTableModel. Since it's just a vector of vectors we tried
nesting iterate tags, but to no avail. Anyone already done this or do I need
to code it myself if I want it (hehe)? :)

Chris



RE: Logic iterate problems

2001-05-10 Thread Nanduri, Amarnath



In 
your jsp page did you do an import on client ?
 

<%@ page import = "beans.Client" %>
 

  -Original Message-From: Sylvain FAGNENT 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 10, 2001 9:33 
  AMTo: [EMAIL PROTECTED]Subject: Re: Logic 
  iterate problems
  I tried, here is the code in my action 
  :
   
   tabTest= new 
  Vector(); test = new 
  Client(); test.setName("Tata 
  DUBAR"); tabTest.add(test); test 
  = new 
  Client(); test.setName("SFA"); tabTest.add(test);
   session.setAttribute("tabTest",tabTest);
   
  And the JSP code :
   
       
   
  I still have my "cannnot find client bean " 
  error.
   
  Thanks Sylvain !
  
    - Original Message - 
From: 
Nanduri, Amarnath 
To: '[EMAIL PROTECTED]' 

Sent: Thursday, May 10, 2001 3:17 
PM
Subject: RE: Logic iterate 
problems

Maybe use need to use the  
in 
your jsp page. Give it a shot and let me know...
 
cheers,
Amar..

  -Original Message-From: Sylvain FAGNENT [mailto:[EMAIL PROTECTED]]Sent: 
  Thursday, May 10, 2001 9:13 AMTo: [EMAIL PROTECTED]Subject: 
  Re: Logic iterate problems
  Yes , we did ! :-(
  
- Original Message - 
From: 
Dudley Butt@i-Commerce 

To: '[EMAIL PROTECTED]' 

Sent: Thursday, May 10, 2001 3:04 
PM
Subject: RE: Logic iterate 
problems

have u put that object into the session, before 
u get to the form
 
session.setAttribute("tabTest", 
VectorObject);

  -Original Message-From: Sylvain FAGNENT [mailto:[EMAIL PROTECTED]]Sent: 
  Thursday, May 10, 2001 2:57 PMTo: [EMAIL PROTECTED]Subject: 
  Logic iterate problems
  Hello,
   
  I have a Vector Object stored in my 
  session with the key "tabTest" this Vector contains "Client" 
  Objetcs, Client classe have a "name" property.
   
  I use this code in my JSP :
   
      
  
   
  This error is return :
   
  ...JSP Exception : Cannot find bean 
  client in scope null
   
  any help...Thanks
   
  Sylvain


RE: Logic iterate problems

2001-05-10 Thread Nanduri, Amarnath



Maybe 
use need to use the  
in 
your jsp page. Give it a shot and let me know...
 
cheers,
Amar..

  -Original Message-From: Sylvain FAGNENT 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 10, 2001 9:13 
  AMTo: [EMAIL PROTECTED]Subject: Re: Logic 
  iterate problems
  Yes , we did ! :-(
  
- Original Message - 
From: 
Dudley Butt@i-Commerce 
To: '[EMAIL PROTECTED]' 

Sent: Thursday, May 10, 2001 3:04 
PM
Subject: RE: Logic iterate 
problems

have u put that object into the session, before u 
get to the form
 
session.setAttribute("tabTest", 
VectorObject);

  -Original Message-From: Sylvain FAGNENT [mailto:[EMAIL PROTECTED]]Sent: 
  Thursday, May 10, 2001 2:57 PMTo: [EMAIL PROTECTED]Subject: 
  Logic iterate problems
  Hello,
   
  I have a Vector Object stored in my session 
  with the key "tabTest" this Vector contains "Client" Objetcs, Client 
  classe have a "name" property.
   
  I use this code in my JSP :
   
      
   
  This error is return :
   
  ...JSP Exception : Cannot find bean client in 
  scope null
   
  any help...Thanks
   
  Sylvain


RE: Getting hold of the session

2001-05-10 Thread Nanduri, Amarnath

oops  my mistake.. Sorry about my last mail ... I really need some caffeine
before i answer any more questions here 

cheers,
Amar..

-Original Message-
From: Tony Karas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 6:44 AM
To: [EMAIL PROTECTED]
Subject: Re: Getting hold of the session


I assume that you're bean extends ActionForm.can't you get the required 
information you need from the session during the call to the validate() 
method?  This method receives a request object as a parameter.


>From: "Andrew Steady"<[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Getting hold of the session
>Date: Thu, 10 May 2001 10:39:37 +0100
>
>Hi,
>
>One of my getter methods (called by struts) needs to get hold of an object
>in the Session so that it can populate the values of a drop down box based
>upon a call to the "customer" object which is stored in the session.
>Unfortunatley struts does not pass my method the request or the session
>object and neither does it pass either of these to the form constructor so
>I can't store a local reference to it in the form.
>
>This problem must have been encountered and solved by others already, does
>anyone have any suggestions?
>
>Regards,
>
>Andy S
>
>
>
>
>
>[EMAIL PROTECTED] on 10/05/2001 09:57:55
>
>Please respond to [EMAIL PROTECTED]
>
>To:   [EMAIL PROTECTED]
>cc:(bcc: Andrew Steady/Swindon01/Domino01/Kinesis)
>Subject:  Re: Transactional Tokens in the JSP?
>
>
>
>
>Allen,
>You can set the transactional token in your edit Action class with
>saveToken(request). Then you can test the token in
>the submit action.
>I suggest you have a look at the classes EditRegistration and
>SaveRegistration  in the example application.
>Jean-Noel
>- Original Message -
>From: Allen Walker <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, May 10, 2001 10:37 AM
>Subject: Transactional Tokens in the JSP?
>
> > I would like to use the transaction token logic in the Action class.
> > However I am not able to figure out how to place the Transactional Token
>in
> > the JSP so it can be validated against when isTokenValid() is called
>within
> > my Action class. I looked at the Struts source code to find:
> >
> >  protected boolean isTokenValid(HttpServletRequest request) {
> >
> >  // Retrieve the saved transaction token from our session
> >  HttpSession session = request.getSession(false);
> >  if (session == null)
> >  return (false);
> >  String saved = (String)
>session.getAttribute(TRANSACTION_TOKEN_KEY);
> >  if (saved == null)
> >  return (false);
> >
> >  // Retrieve the transaction token included in this request
> >  String token = (String)
>request.getParameter(Constants.TOKEN_KEY);
> >  if (token == null)
> >  return (false);
> >
> >  // Do the values match?
> >  return (saved.equals(token));
> >
> >  }
> >
> > The Contants class is org.apache.struts.taglib.html.Constants.
> >
> > Thanks for any help
> > -allen-
> >
> >
>
>
>
>
>
>
>
>The information transmitted is intended only for the person or entity to 
>which it is addressed and may contain confidential and/or privileged 
>material.  Any review, retransmission, dissemination 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 in error, please contact the sender and delete the material from any 
>computer.
>
>PricewaterhouseCoopers Kinesis Ltd

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



RE: Getting hold of the session

2001-05-10 Thread Nanduri, Amarnath



  Use this...   ActionForm.getServlet().getSession() .

cheers,
Amar..

-Original Message-
From: Tony Karas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 6:44 AM
To: [EMAIL PROTECTED]
Subject: Re: Getting hold of the session


I assume that you're bean extends ActionForm.can't you get the required 
information you need from the session during the call to the validate() 
method?  This method receives a request object as a parameter.


>From: "Andrew Steady"<[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Getting hold of the session
>Date: Thu, 10 May 2001 10:39:37 +0100
>
>Hi,
>
>One of my getter methods (called by struts) needs to get hold of an object
>in the Session so that it can populate the values of a drop down box based
>upon a call to the "customer" object which is stored in the session.
>Unfortunatley struts does not pass my method the request or the session
>object and neither does it pass either of these to the form constructor so
>I can't store a local reference to it in the form.
>
>This problem must have been encountered and solved by others already, does
>anyone have any suggestions?
>
>Regards,
>
>Andy S
>
>
>
>
>
>[EMAIL PROTECTED] on 10/05/2001 09:57:55
>
>Please respond to [EMAIL PROTECTED]
>
>To:   [EMAIL PROTECTED]
>cc:(bcc: Andrew Steady/Swindon01/Domino01/Kinesis)
>Subject:  Re: Transactional Tokens in the JSP?
>
>
>
>
>Allen,
>You can set the transactional token in your edit Action class with
>saveToken(request). Then you can test the token in
>the submit action.
>I suggest you have a look at the classes EditRegistration and
>SaveRegistration  in the example application.
>Jean-Noel
>- Original Message -
>From: Allen Walker <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, May 10, 2001 10:37 AM
>Subject: Transactional Tokens in the JSP?
>
> > I would like to use the transaction token logic in the Action class.
> > However I am not able to figure out how to place the Transactional Token
>in
> > the JSP so it can be validated against when isTokenValid() is called
>within
> > my Action class. I looked at the Struts source code to find:
> >
> >  protected boolean isTokenValid(HttpServletRequest request) {
> >
> >  // Retrieve the saved transaction token from our session
> >  HttpSession session = request.getSession(false);
> >  if (session == null)
> >  return (false);
> >  String saved = (String)
>session.getAttribute(TRANSACTION_TOKEN_KEY);
> >  if (saved == null)
> >  return (false);
> >
> >  // Retrieve the transaction token included in this request
> >  String token = (String)
>request.getParameter(Constants.TOKEN_KEY);
> >  if (token == null)
> >  return (false);
> >
> >  // Do the values match?
> >  return (saved.equals(token));
> >
> >  }
> >
> > The Contants class is org.apache.struts.taglib.html.Constants.
> >
> > Thanks for any help
> > -allen-
> >
> >
>
>
>
>
>
>
>
>The information transmitted is intended only for the person or entity to 
>which it is addressed and may contain confidential and/or privileged 
>material.  Any review, retransmission, dissemination 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 in error, please contact the sender and delete the material from any 
>computer.
>
>PricewaterhouseCoopers Kinesis Ltd

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



RE: Basic Design Question...

2001-05-10 Thread Nanduri, Amarnath

The problem with multiple servlets.

1) Security is a pain when you should check in each and every servlet. In a
single servlet you have one point of entry/ on point of exit. So security
can be implemented quite efficiently.

2) Ease of maintenance. For example when you are porting across multiple
servlet engines then maintenance is a problem.

3) Changes in how you handle your requests can be easily applied (since you
handle them at nly one servlet).

I am sure that there are tons of other reasons out there. However i think
the above points are valid enough for me to stick to a single servlet
instead of multiple ones... I worked on projects before (when the servlet
api has come out) where i used multilpe servlets. Trust me, it is not a
pleasant thought for me now when i think of those times, cause i ran into
all those problems i had mentioned above.

cheers,
Amar..

-Original Message-
From: Prakash Dominic [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 6:52 PM
To: [EMAIL PROTECTED];
"'[EMAIL PROTECTED]'"@jaydemail.com;
[EMAIL PROTECTED]
Subject: RE: Basic Design Question...



I understand MVC/Model 2.  And I don't
think Action layer in Struts map to Model in MVC. 
Actions in Struts are -Controllers- in the MVC pattern as they translate
user actions to the Model and select the appropriateView.

The point I was trying to make was that, instead of
creating a whole new set of APIs why not leverage the
existing Servlet API/spec for the -Controller- layer. 

And I am not still clear what the problem is with having
many Servlets(still java instances under the hood).

--Prakash


-Original Message-
From: Jason Chaffee <[EMAIL PROTECTED]>
Date: Wed, 9 May 2001 14:03:01 -0700 
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: RE: Basic Design Question...


> Read up on the MVC/Model 2 design pattern.  Struts is based on this design
> pattern.  It much better to have one servlet (controller) and several
> actions (models), than to have serveral servlets.
> 
> -Original Message-
> From: Prakash Dominic [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 09, 2001 2:04 PM
> To: [EMAIL PROTECTED]
> Subject: Basic Design Question...
> 
> 
> Hello Folks,
> 
> A quick design question. This might be nit 
> picking from a design standpoint but still a
> valid question.
> 
> Struts uses the Action.perform(...) API for 
> action hadling/controller. I am curious to know
> why Servlets can't be used for the Action Handling
> layer. That way there is no need to introduce
> 2 new APIs to learn - Action and struts-config.xml.
> 
> The web.xml could replace the struts-config for 
> action mapping. And framework users simply implement
> Servlets instead of Action subclasses.
> 
> Does this make sense or am I am missing something
> here ?
> 
> Thanks,
> Prakash
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> ===
> 
> Another FREE service from Jayde Online < http://www.jayde.com>"
TARGET="_new">http://www.jayde.com>
> Private, Web-based email accounts at  http://www.jaydemail.com";
TARGET="_new">http://www.jaydemail.com
> 
> Powered by Outblaze
> 

-- 

===

Another FREE service from Jayde Online 
Private, Web-based email accounts at http://www.jaydemail.com

Powered by Outblaze



RE: Session management with Struts

2001-05-10 Thread Nanduri, Amarnath

In that case i would advise you to maintain a Hashmap/Hashtable of form
objects wrapped inside an Global Action form (session scope). Every time a
user opens a new browser window, i am sure that a unique id can be generated
for the new window ( i have seen a posting on this list a month back where
somebody has explained that using javascript we can generate a unique id for
every new web browser that was opened by the user). Store this id in a
hidden name=value pair. Check the mail archives as to how to do this.
Over-ride your ActionServlet service() method where you initially check the
id of the browser window. (btw the form objects wrapped inside the
GlobalActionForm object will be mapped to these id's.) . When the
corresponding form object is found, then you populate the data in that form
object. If no form object is found, then create a new form object and
populate the data in that form object (using reflection). Struts has
libraries to do this. This is a complicated way of doing it, but the best
that could pop out of my brain this time...(morning blues. I could use some
caffeine). 


cheers,
Amar..

-Original Message-
From: TJM Todd McGregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 5:44 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Session management with Struts


But that's exactly my problem. I have forms that may span multiple pages and
the ActionForm needs to be available across multiple requests. Any ideas

-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 1:53 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Session management with Struts


Keep the ActionForms in 'request' scope. Then each page will have its own
ActionForm. The problme occurs when you want to store these forms in session
scope. 

cheers,
Amar..

-Original Message-
From: TJM Todd McGregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 4:49 PM
To: [EMAIL PROTECTED]
Subject: Session management with Struts


I have a requirement that my application be able to allow multiple browser
windows, sharing the same HttpSession, to access two separate instances of a
business process simultaneously. For example, if I have a form that allows a
user to change their address information my application must allow them to
have two address forms open in separate browser windows using the same
HttpSession. To make a long story short, can Struts accommodate multiple
instances of an ActionForm in the same session? Any general comments on how
Struts does session management would also be welcome.

Thanks in advance for your response,

Todd McGregor



RE: Bug in order of error presentment (html:error)

2001-05-09 Thread Nanduri, Amarnath



I 
don't think it is a bug. I think the  is using an Iterator. 
there is no guarantee of ordering in an Iterator. Correct me if i am 
wrong.
 
cheers,
Amar..

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, May 09, 2001 4:47 
  PMTo: [EMAIL PROTECTED]Subject: Bug in 
  order of error presentment (html:error)
  In Form.Validate()
  {
  ...
      if 
  (getCustomerContactName().length() <= 
  1)    
  errors.add("customerContactName", new 
  ActionError("error.customercontactname.required"));    
      if 
  (getCustomerContactPhone().length() <= 
  1)    
  errors.add("customerContactPhone", new 
  ActionError("error.customercontactphone.required"));    
      if 
  (getCustomerContactEmail().length() <= 
  1)    
  errors.add("customerContactEmail", new 
  ActionError("error.customercontactemail.required"));...
  }
   
  In Properties file:
  error.customercontactname.required=Contact Name is a 
  required 
  fielderror.customercontactphone.required=Contact 
  Phone is a required 
  fielderror.customercontactemail.required=Contact 
  Email is a required field
  Output from html:errors:
  
  


  Contact Phone is a 
required fieldContact Name is a required fieldContact 
Email is a required field

   
  Note the ordering.  Name should have 
  preceded Phone.
   


RE: Session management with Struts

2001-05-09 Thread Nanduri, Amarnath

Keep the ActionForms in 'request' scope. Then each page will have its own
ActionForm. The problme occurs when you want to store these forms in session
scope. 

cheers,
Amar..

-Original Message-
From: TJM Todd McGregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 4:49 PM
To: [EMAIL PROTECTED]
Subject: Session management with Struts


I have a requirement that my application be able to allow multiple browser
windows, sharing the same HttpSession, to access two separate instances of a
business process simultaneously. For example, if I have a form that allows a
user to change their address information my application must allow them to
have two address forms open in separate browser windows using the same
HttpSession. To make a long story short, can Struts accommodate multiple
instances of an ActionForm in the same session? Any general comments on how
Struts does session management would also be welcome.

Thanks in advance for your response,

Todd McGregor



RE: please help...this doesn't want to display the exception, is this correct?

2001-05-09 Thread Nanduri, Amarnath

I believe in the erros tag you need to do something like this...


  errors.add( (ActionErrors.GLOBAL_ERROR,
 new ActionError("error.exception"));


 The reson is that the error msg which gets send back to the user is
internationalized (i.e a user in France sees the error in french, a user in
India sees the error in Hindi etc...).  'error.exception' should be in your
properties file. Based on what you were doing, struts tries to find a  msg
in your properties file (for  ex.toString() ) which is not present in the
properties file. So it fails.

cheers,
Amar..



-Original Message-
From: Dudley Butt@i-Commerce [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 4:55 AM
To: '[EMAIL PROTECTED]'
Subject: please help...this doesn't want to display the exception, is
this correct?


} catch (Exception ex) {
  ex.printStackTrace();
  errors = new ActionErrors();
  errors.add("beanErr",new ActionError(ex.toString()));
}   




RE: Override Input Form / JSP when Errors Are Encountered

2001-05-09 Thread Nanduri, Amarnath



In 
that case try to move your validation into the Action class. 


  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, May 08, 2001 5:13 
  PMTo: [EMAIL PROTECTED]Subject: Re: 
  Override Input Form / JSP when Errors Are Encountered
  That doesn't work - that is my problem.  I 
  don't have a chance to do this in my Action class since the presence of errors 
  generated in form.validate() triggers an immediate response by the framework 
  and redirection occurs automagically to the input form (page 1), not the page 
  which caused the error (eg page 2).
   
  
- Original Message - 
From: 
    Nanduri, Amarnath 
To: '[EMAIL PROTECTED]' 

Sent: Tuesday, May 08, 2001 3:56 
PM
Subject: RE: Override Input Form / JSP 
when Errors Are Encountered

 
instead of   mapping.findForward(mapping.getInput() )  
use   mapping.findForward("page2 or page3" ) 
;

  -Original Message-From: Jeff Trent [mailto:[EMAIL PROTECTED]]Sent: 
  Tuesday, May 08, 2001 3:17 PMTo: [EMAIL PROTECTED]Subject: 
  Override Input Form / JSP when Errors Are Encountered
  When validate() returns an error collection, 
  the framework takes me back to the input page (page1).  How do I 
  override this?  I have a multi-page input wizard as shown 
  below.  I'd like to stay on the page that resulted in the error 
  instead of going back to page 1.
   
      
     
  type="com.x.WizardAction"   
  name="wizardForm"  
  scope="session"  
  input="/page1.jsp">    
      
      
  


RE: Form Attribute limitation

2001-05-08 Thread Nanduri, Amarnath

Yeah. Check the mailing list archives. Somebody has explained the problem
with a solution.

cheers,
Amar..

-Original Message-
From: Nageshwar Charka [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 4:07 PM
To: '[EMAIL PROTECTED]'
Subject: Form Attribute limitation


Hello All,
We cannot have an attribute name in the form bean as:

String aBookkeeping;

I get an Exception:

javax.servlet.jsp.JspException: No getter method for property aBookkeeping
of bean org.apache.struts.taglib.html.BEAN
I do have set/get methods for above as, setABookkeeping/getABookkeeping in
form bean.

I have created a form with hundreds of attributes now I have to change their
names and methods two.
It works if I declare it as : abookkeeping or abookKeeping but not
aBookkeeping

Anybody is heard of such problem before. 

Thanks in advance

-nagesh




RE: Override Input Form / JSP when Errors Are Encountered

2001-05-08 Thread Nanduri, Amarnath



 
instead of   mapping.findForward(mapping.getInput() )  
use   mapping.findForward("page2 or page3" ) 
;

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, May 08, 2001 3:17 
  PMTo: [EMAIL PROTECTED]Subject: Override 
  Input Form / JSP when Errors Are Encountered
  When validate() returns an error collection, the 
  framework takes me back to the input page (page1).  How do I override 
  this?  I have a multi-page input wizard as shown below.  I'd like to 
  stay on the page that resulted in the error instead of going back to page 
  1.
   
         
  type="com.x.WizardAction"   
  name="wizardForm"  
  scope="session"  
  input="/page1.jsp">    
      
      


RE: tomcat 3.2.1 and IIS problem

2001-05-08 Thread Nanduri, Amarnath

Yeah can somebody send an explaination as to why this happens ?  Thanks a
lot.

cheers,
Amar..

-Original Message-
From: Sundaram Ramasamy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 3:13 PM
To: [EMAIL PROTECTED]
Subject: tomcat 3.2.1 and IIS problem




Hi,

I am trying to setup tomcat and IIS in win2000, followed the
tomcat-iss-howto instructions
(http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/tomcat-iis-howto.ht
ml)



Port for the webservers: tomcat - 8000 and IIS - 8080

While try to access the url

http://localhost:8080/examples/jsp/index.jsp


its giving me error message ( page not found). I look in to the log file,

IIS log file message:

2001-05-08 19:09:26 127.0.0.1 - 127.0.0.1 8080 GET
/jakarta/isapi_redirect.dll - 200
Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0)


isapi log file:
[jk_ajp12_worker.c (148)]: In jk_endpoint_t::service, sent request
[jk_ajp12_worker.c (488)]: Into ajpv12_handle_response
[jk_ajp12_worker.c (502)]: ajpv12_handle_response, read Status: 404 Not
Found
[jk_ajp12_worker.c (530)]: ajpv12_handle_response, read Status=404 Not Found
[jk_ajp12_worker.c (502)]: ajpv12_handle_response, read Content-Type:
text/html
[jk_ajp12_worker.c (530)]: ajpv12_handle_response, read
Content-Type=text/html
[jk_ajp12_worker.c (542)]: ajpv12_handle_response, allocating header arrays
[jk_ajp12_worker.c (502)]: ajpv12_handle_response, read Content-Length: 193
[jk_ajp12_worker.c (530)]: ajpv12_handle_response, read Content-Length=193
[jk_ajp12_worker.c (502)]: ajpv12_handle_response, read Servlet-Engine:
Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 1.3.0; Windows 2000 5.0
x86; java.vendor=Sun Microsystems Inc.)
[jk_ajp12_worker.c (530)]: ajpv12_handle_response, read
Servlet-Engine=Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 1.3.0;
Windows 2000 5.0 x86; java.vendor=Sun Microsystems Inc.)
[jk_ajp12_worker.c (502)]: ajpv12_handle_response, read
[jk_ajp12_worker.c (504)]: ajpv12_handle_response, headers are done
[jk_ajp12_worker.c (563)]: ajpv12_handle_response, starting response
[jk_isapi_plugin.c (201)]: Into jk_ws_service_t::start_response
[jk_ajp12_worker.c (574)]: ajpv12_handle_response, reading response body
[jk_isapi_plugin.c (335)]: Into jk_ws_service_t::write
[jk_ajp12_worker.c (590)]: ajpv12_handle_response, response body is done
[jk_ajp12_worker.c (602)]: ajpv12_handle_response done
[jk_isapi_plugin.c (551)]: HttpExtensionProc service() returned OK
[jk_ajp12_worker.c (163)]: Into jk_endpoint_t::done


Can any one help me, what I am going wrong in this.

Cheers
Sundaram




run scripts when using struts in deployment mode

2001-05-08 Thread Nanduri, Amarnath


Hi All,

  I have a question about Struts when used at deployment. Is there a way
i can build a script that starts up whenever the application server starts
up. I would prefer using Ant but i am open to options. This script would hit
all the strut-enabled webpages (so that they will be in memory) . When the
first user hits the website he/she will get a faster response time. I am
curious to know if anybody has done that and if so can they share their
experiences. Can something like this be an integral part of struts ?
(possibly an example) Thanks a lot.

cheers,
Amar..



RE: Struts power point presentation

2001-05-08 Thread Nanduri, Amarnath

Not able to open the webpage

-Original Message-
From: LORENA MASSIMO [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 2:49 AM
To: '[EMAIL PROTECTED]'
Subject: R:Struts power point presentation


you can find it in 
http://www.us-eh.com/craiger/articles/struts/
Max

> --
> Da:   Nick Afshartous[SMTP:[EMAIL PROTECTED]]
> Risposta a:   [EMAIL PROTECTED]
> Inviato:  lunedì 7 maggio 2001 22:11
> A:[EMAIL PROTECTED]
> Oggetto:  Struts power point presentation
> 
> 
> Hi,
> 
> Someone had previously posted a power point presentation to the
> list (Struts overview).  Is it still available somewhere ?
> Thanks for any info.
> -- 
> 
>   Nick
> 
> 
> 



RE: Potential Security Flaw in Struts MVC

2001-05-07 Thread Nanduri, Amarnath



Any 
thing dealing with security, (including security validation) keep it in the 
request scope. That way no other developer (at runtime) can access the security 
data.
[Nanduri, 
Amarnath]  -Original Message-From: 
Hogan, John [mailto:[EMAIL PROTECTED]]Sent: Monday, May 07, 2001 
1:10 PMTo: '[EMAIL PROTECTED]'Subject: RE: 
Potential Security Flaw in Struts MVC

  Wouldn't this not be a concern because the user would 
  never be in the session on the target server?
  
-Original Message-From: Jeff Trent 
[mailto:[EMAIL PROTECTED]]Sent: Monday, May 07, 2001 11:37 
AMTo: [EMAIL PROTECTED]Subject: Potential 
Security Flaw in Struts MVC
I may be wrong about this (only been working w/ 
Struts for a week now).  But I do see a potential security flaw in 
struts that I would like to hear from others regarding.
 
Consider a simple set of struts classes that 
represent a user in a system. You would probably have classes that look 
something like this:
    User    
            (the model 
representing the user)
    UserForm    
    (an enrollment form for a new user)
    UserAction    
    (Saves the UserForm information to db, etc)
    
The User class would have accessors and 
modifiers like getFirstName(), setFirstName(), getAdministrativeUserFlag(), 
setAdministrativeUserFlag(), etc.  The basic implementation of the 
UserForm is to take the UI form data, introspect the beans, and call the 
correct modifier of the UserForm bean based on the fields contained within 
the UI submission/form.  A developer of course would not expose the 
"Administrative User Flag" option on the UI for enrollment (that would be 
found possibly in some other administrative-level module).  However, if 
someone is familiar with the db schema and the naming convention the 
developer used, that user could subvert the application by writing his own 
version of the UI which contains an "Administrative User Flag" field (or any 
other field for that matter) and the basic form processing in Struts will 
kindly honor the request and set the "Administrative Flag" on the 
user.  Unless, of course, the developer makes special provisions to 
prevent this behavior.  However, its not entirely obvious to the struts 
user (in my opinion) that this is even a concern.  Am I making sense 
here?
 
- jeff
 


RE: ActionServlet to change language ?

2001-05-07 Thread Nanduri, Amarnath
Title: RE: ActionServlet to change language ?



An 
other method i would advise is 
 
In 
your action class just call the setLocale() passing in the parameter(language 
preference) the user has selected. That way you can be assured of not 
making an if-elseif-else call
 

  -Original Message-From: Jason Chaffee 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, May 07, 2001 1:07 
  PMTo: '[EMAIL PROTECTED]'Subject: RE: 
  ActionServlet to change language ?
  One solution is for each page to have a hidden field that 
  contains it's relative path.  Then you can forard to that page after you 
  have changed the locale.
  -Original Message- From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
  Sent: Monday, May 07, 2001 5:17 AM To: [EMAIL PROTECTED] Subject: 
  ActionServlet to change language ? 
  Hi all, 
  I want to use a simple action to change the language in a 
  site, but I would like this feature to be available on 
  all pages of the site. I'm using a template, and the 
  same menu (with language selection) is included in 
  each page. My question is : When a visitor decide to 
  change the language, how could I know the URL where he 
  was and where I had to come back ? 
  In other words, how can I complete the following code ? 
  
  + public final class ChangeLang extends Action { 
      public ActionForward perform( 
      
  ActionMapping mapping,     
  ActionForm form,     
  HttpServletRequest request,     
  HttpServletResponse response)    throws IOException, 
  ServletException { 
     // Extract parameters we 
  will need     String requested = 
  (String)request.getParameter( "lang" ); 
      if( requested == null )    return 
  (mapping.findForward("error"));     if( 
  requested.equalsIgnoreCase( "FR" ) )   setLocale( request, Locale.FRANCE 
  );     if( requested.equalsIgnoreCase( 
  "UK" ) )   setLocale( 
  request, Locale.UK );     if( 
  requested.equalsIgnoreCase( "DE" ) )   setLocale( request, Locale.GERMAN 
  ); 
      return ( ? );     } 
      protected void setLocale( 
  HttpServletRequest request, Locale locale ) 
    {   HttpSession session = 
  request.getSession(false);   if (session != null)     
  session.setAttribute(Action.LOCALE_KEY, locale);   } } 
  + 
  In my strus-config.xml : 
  +                
      
  + 
  My menu : 
  + <%@ taglib uri='/WEB-INF/struts-html.tld' prefix='html' %> 
  Select Language : FR | EN 
  | NL | D 
     
   + 
  Thanks. -- Olivier DUCHÊNE 


RE: Struts questions for evaluation

2001-05-07 Thread Nanduri, Amarnath

me too

-Original Message-
From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 8:21 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Struts questions for evaluation


I am interested in the code.   Please send.

> Hello Struts users,
>
> We are currently evaluating Struts and other web (MVC) frameworks and
would like to ask you some questions:
>
> - Is there some struts-config XML-generation from some
>   modeling tool (Rose for instance) ?
>
>   We would like to design a state or activity diagram in
>   such a tool then generate the navigation XML file.
>
> - Can struts behave like a real state machine ?
>
>   i.e. how to ensure that some Action is performed only if
>   another Action (or view but is not ideal) has been
>   performed with some result (success to be simple). We
>   would like this to be Struts-controlled, not developper-
>   controlled (check session variables, etc.).
>
>   We found the built-in Struts token system but this seem
>   only to be used to demarcate transactions in a set of
>   views. This allow to demarcate a transaction end (token
>   value change) but not an inconstency within the
>   transaction (i.e. i valide twice the first page of the
>   transaction) as the token value will not change.

I hit the same weakness of struts a few months ago and I enhanced some
struts
classes in order to be able for each action to specify which action has to
precede this action. This allows you to implement some kind of control flow.
For
instance you can now define an action that displays a logon page
(displayLogon)
and specify in the next action (logonAction, which gets executed when the
user
presses the submit button of the logon page) that displayLogon needed to be
executed directly before. This is more powerful than the token mechanism.

What I also did at the same time is an enhanced user authentication checking
for
each action. You can now specify a different user authorization class for
each
action, so you can easily implement a very fine grained user authorization.

Exceptions (either control flow or user authentication exceptions) are
handled
by the framework and cause a forward to different error pages.

I plan to propose this enhancement to the struts developer's group after
release
1.0 is out. If you are interested in the meantime I can send you the code.

> - Why does the struts-example perform some scoped-
>   variables cleanup at the end of every Action ?
>
>   As these variables are defined as scoped in the struts-
>   config XML file, they should naturally live during the
>   specified scope lifetime. We don't understand that in the
>   struts-example (maybe this is not mandatory).

My understanding is: For request scope you normally do not need to clean up,
because the object gets removed automatically, when the request is served.
For
the session scope you pretty often want to remove e. g. a form bean, when it
is
no longer needed to keep your session data lean.

> Thank you very much for your informations about Struts.
>
>   Laurent.

--- Matthias
- Original Message -
From: "Matthias Bauer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 07, 2001 4:05 AM
Subject: Re: JDBC driver specific functionality/GenericConnections


> > Hello,
> >
> > I would like to access functionality specific to the MM MySql driver in
an
> > application that uses Struts' datasource pool and am having a bit of
> > troubling casting a GenericConnection back to an
> > org.gjt.mm.mysql.Connection. Casting from a GenericConnection to an
> > org.gjt.mm.mysql.Connection results in a class cast exception; casting a
> > Statement or PreparedStatement generated by the GenericConnection
produces a
> > null pointer exception. I am working with Struts 1.0-beta-1 and MM Mysql
> > 2.0.4.
> >
> > If it sheds any light on the problem, the MM function I would like to
access
> > is PreparedStatement.getLastInsertID(). Has anyone successfully
prosecuted
> > this?
>
> You must not cast GenericConnection to  What you really want to do is call
> DataSource.getConnection which returns a Connection object like so:
>
>   DataSource ds = getServlet().findDataSource(null);
>   Connection con = ds.getConnection();
>
> You can cast this connection to org.gjt.mm.mysql.Connection without any
> problems!
>
>
> > On a tangential note--why is the getConnection() method in
GenericConnection
> > private? Were it public, I assume I could use it to get an MM Connection
and
> > execute MySql specific functions to my heart's content.
>
> You should never need to call GenericConnection.getConnection()! What you
want
> to do is always call DataSource.getConnection(), as stated above.
>
> > Thanks is advance,
> > David
>
> Hope this helps,
>
> --- Matthias
>



RE: A Question about Transaction Tokens

2001-05-04 Thread Nanduri, Amarnath



The 
token is send as a hidden name=value pair in your html page. I believe a copy of 
the same value is stored in session object. When the user submits information 
back to the server, both these values are compared to make sure that they both 
match. If they both match, then the isTokenValid() returns  true, else 
false . Hope this helps.
 
cheers,
Amar..

  -Original Message-From: yogesh kapoor 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, May 04, 2001 1:11 
  PMTo: [EMAIL PROTECTED]Subject: A Question 
  about Transaction Tokens
  
  Hi All,
    
  I have just installed the struts1.0 b1 and the struts-example app. I wonder 
  how the transaction token key works.Can anybody explain that to me please(it 
  is a great stuff). 
    
  I checked out the code a bit and found out that struts is creating a 
  transaction token key by convereting the session id and the current time to 
  byte array and appending it to a message digest . So how can the two 
  tokens(one set before displaying the form and another set when 
  submitting?) be equated when they have a time element involved in them.Antoher 
  thing i could not undsrstand was that while saving the form the code retrieves 
  the token using the request.getParameter(token_key), but where are we setting 
  this paramater?
  Can 
  somebody explain , how are things working here?
  Regards,
  Yogesh
  
  Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
  


RE: Bean:message with args

2001-05-04 Thread Nanduri, Amarnath


Hello everybody,
 
 I am trying to test the iterate tag and i am getting the following error..
Can somebody point out as to what i am doing wrong ? Thanks a lot. I am
including the jsp code also. I am using Tomcat 3.2 and struts 1.0

cheers,
Amar..

ERROR
-
javax.servlet.ServletException: Cannot create iterator for this collection
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
at
_0002fpagerTest_0002ejsppagerTest_jsp_0._jspService(_0002fpagerTest_0002ejsp
pagerTest_jsp_0.java, Compiled Code)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



BEAN


public class StatesBean
{

  // stores an array list of states
  private  ArrayList  states  = new ArrayList() ;

  public StatesBean()
  {
states.add("ALABAMA");
states.add("ALASKA");
states.add("ARIZONA");
states.add("ARKANSAS" ) ;
states.add("CALIFORNIA") ;
states.add("COLORADO") ;
states.add("CONNECTICUT") ; 
  }


  public  Iterator  getStates()
  {
 return  states.iterator() ;
  }
}


JSP:


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page import =
"com.agilquest.onboard.presentation.actionforms.StatesBean" %>

<%
  {
com.agilquest.onboard.presentation.actionforms.StatesBean  statesBean =
new com.agilquest.onboard.presentation.actionforms.StatesBean() ;

pageContext.setAttribute("statesBean", statesBean,
PageContext.PAGE_SCOPE);
  }
%>














  

  



RE: regd. action classes --- please help

2001-05-04 Thread Nanduri, Amarnath

I would advise that you subclass the Action class, like  ObjectAction. the
below piece of code would work fine for you...
The parameters in the perform method will be send to the execute() method in
your subclasses. Hope this helps for ya all
If you want, you can also make the init() and destroy() methods abstract (if
each subclass wants to do soemthing different in the
init() and destroy() methods ).



cheers,
Amar..


  public abstract class ObjectAction  extends  Action
  {

   public  ActionForward  perform( , , , )
   {

init() ;

execute( , , , ) ;

destroy() ;
   }

   protected  abstract  ActionForward  execute( , , , ) ;

  }



  public  class  Subaction  extends  ObjectAction
  {

   protected  void  execute( , , , ) 
   {

   }

  }


-Original Message-
From: Manabendra Sarkar [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 04, 2001 6:38 AM
To: [EMAIL PROTECTED]
Subject: regd. action classes --- please help


Hi All,
  is there init() and destroy() like methods in Action class so that we
can be sure that those methods will always be called
by the action servlet?
  actually i need to aquire some resources (like database connection)
and initialize the action class. i want to hold thoise resources
through out the life of the action object. i want to release those resources
only when i don't need the action object anymore.   
 please help me in doing this. any other procedure to do this except
init() & destroy() ? 


Regards

Manabendra Sarkar



RE: I8N newbie question

2001-05-03 Thread Nanduri, Amarnath

Why do you want to translate the submit value ? Try this then and it will
work. Constants is a java file. This name will be send back to the server if
you press this button. The message appearing to the user is
internationalized.



  



cheers,
Amar..


-Original Message-
From: Kris Vandenberk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 1:49 PM
To: [EMAIL PROTECTED]
Subject: I8N newbie question


Hi,

let's say I have the following piece of code :


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>


  
    

   



  


//

The translation of Username and Password works, but how can I translate the
submit value ... ?


thanks

Kris



RE: Internationalised strings and scriptlets

2001-05-03 Thread Nanduri, Amarnath

OhBoy. I would never do this. The main reason is that if ou are
internationalizing your app, you never know what the next language you are
going to support in your application. So if you wrote for some particualr
languages and you want to include an other language you need to rewrite the
whole app. I would suggest that you use a keycode (for every kind of message
out there). This keycode is mapped to a table in a database. Then redesign
your app to do something with it.

cheers,
Amar..

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 4:45 AM
To: [EMAIL PROTECTED]
Subject: Internationalised strings and scriptlets



Is it possible to access internationalised messages from inside scriptlets? 

For example consider a dropdown list populated with text strings produced by
a 
 tag.  I then want to do some processing based on a user

selection:

 <% 
 String selectedItem = request.getParameter( "dropDown" );
 String internationalisedString = ???
 if ( selectedItem.equals( internationalisedString ) ) 
 {
// do something
 } 
 %>

How do I get a value for internationalisedString?

Thanks,
Sam



--
This message was sent using http://uk2.net
NEWS - CHEAPEST DEDICATED SERVERS IN THE WORLD -  25/month
FREE UK DIAL 0845 609 1370 - username uk2: - password: uk2
UK's FREE Domains, FREE Dialup, FREE Webdesign, FREE email




RE: Jsp not displayed on first time.

2001-05-03 Thread Nanduri, Amarnath

Yeah. I get the same problem with Weblogic 6. I think it is a bug with
WebLogic hot deploy mechanism. You need to stop and start weblogic again for
this problem to disappear. 

cheers,
Amar..

-Original Message-
From: Tewathia, Atul [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 2:43 AM
To: [EMAIL PROTECTED]
Subject: Jsp not displayed on first time.




Whenever I start my application after redeploy I get the error given below.
But on a subsequent refresh of the page the browser displays the jsp on the
screen exactly fine. This happens for every jsp in my application. Does any
body know why this happens ?

  
<[WebAppServletContext(786280
,withdraw)] Servlet failed with Exception
java.lang.ClassCastException: org.apache.struts.action.ActionMappings
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:696)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:441)
at jsp_servlet._contactinfo._jspService(_contactinfo.java:90)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:208)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:244)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>



Tomcat 3.2.2 beta with Struts

2001-05-02 Thread Nanduri, Amarnath

Hi,

  I am getting this error. I would appreciate anyone pointing out a
solution to this problem. This works fine with Weblogic 6. Thanks.

cheers,
Amar..

javax.servlet.jsp.JspException: Missing message for key 
login.title
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242)
at
_0002flogin_0002ejsplogin_jsp_0._jspService(_0002flogin_0002ejsplogin_jsp_0.
java, Compiled Code)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)



  1   2   >