Automathic user authentication

2001-05-13 Thread LORENA MASSIMO

hi everibody,

i'm developing for myintranet a web app based on apache/tomcat/struts.
My users are using NT Wks on a NT Domain.
I'm trying to auto-authenticate the users using the NT Logon User.

Somebody told me to use the following jsp code
String logon_user = Request.ServerVariables("LOGON_USER");
but the class Request is unknown in Tomcat (ok with JRUN)

Somebody told me to use the following code
String logon_user = request.getRemoteUser();
but it return null (or empty String)

Can anybody suggest me any other solutions?

Thanks MaxL








Hi , Log4j does not write in file

2001-05-13 Thread Harish Muleva

hi am using log4j for sateless bean 
i want to all INFO and DEBUG Massage in one file say xx_11.i was able to
write for client part but i am unable to get from Bean in the xx_11. details
of problem is given below
 
 i mention in config file as log4j.appender.A2.File=xx_11
and i declere in Client Catgory asstatic Category CAT =
Category.getInstance(Client.class.getName());
and i set PropertyConfigurator as  PropertyConfigurator.configure("
sort.lcf");
when i run this Client i get the out put in xx_11 which is from only Client
and i am unable to get from the Bean
 
my code is 
this
Client  is  
package com.mindtree.emsFramework.dim;

import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Properties;
import java.util.Vector;
import java.util.Iterator;

import javax.ejb.CreateException;
import javax.ejb.DuplicateKeyException;
import javax.ejb.FinderException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.RemoveException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import java.util.Enumeration;
import com.mindtree.emsFramework.common.SerializableEmsAlarm;
import com.mindtree.emsFramework.common.SerializableMOInstance;

import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.Category;
import org.apache.log4j.Priority;
import org.apache.log4j.BasicConfigurator;

public class Client {

private String url = null;
private DatabaseLogHome home ;
private String primarykey = null;
private String arraylength=null;
static Category CAT = Category.getInstance(Client.class.getName());
public Client(String url,String primarykey) throws NamingException {
this.url= url;
this.primarykey = primarykey;
home = lookupHome();
}

/**
* .Client "t3://localhost:8001" 10020
* 
* @param url   URL such as "t3://localhost:7001" of
Server
*/


public static void main(String[] args) {

BasicConfigurator.configure();
System.out.println("\nBeginning dim.Client...\n");
CAT.info("Populating an array of ");
Client client = null;

try {String name=null;
if (args[1]==null)
{usage("sosos");
CAT.info("SDFDGDF");}
name=args[1];
client = new Client(args[0],args[1]);
} catch (NamingException ne) {
CAT.info("Unable to look up the beans home: " +
ne.getMessage());
System.exit(1);
}
CAT.info("Populating an array of ");
Client.init(args[2]);
try {
DatabaseLog ac = client.createDatabaseLog();
//SerializableEmsAlarm alarm[] = new
SerializableEmsAlarm[20];
CAT.info("Finished adding a record");
String[] s = new String[1];
String[] y = new String[1];
s[0] = new String("seqNumber>=1000");
y[0] = new String("seqNumber desc");
String t = new String("Or");
 
SerializableEmsAlarm[] alarm = ac.queryAlarms(s,y,t);
   
alarm = ac.queryAlarms(s,y,t);
System.out.println("array length = "+alarm.length);
  
for(int i =0; i < alarm.length;i++){
CAT.info("\n\n\n result of time alarm"+alarm[i].eventTime);
CAT.info("\n\n\n result of time alarm"+alarm[i].seqNumber);
System.out.println("\n\n our result" +ac.queryAlarms(s,y,t));
System.out.println("\n\n our result" +
ac.getSequenceNumber());

CAT.info("Populating an array of ");
}
 
   
CAT.info("Populating an array of D ");  
usage(" There was an exception while creating and using the DAtaB");
}catch (Exception e) {
//CAT.info("Populating an array of dfgfjifjdfjgf");
usage(" There was an exception while creating and using the DAtaB");
CAT.info("There was an exception while creating and using the
DAtaBasE.");
CAT.info("This indicates that there was a problem
communicating with " +
"the server: "+e);
}

System.out.println("\nEnd containerManaged.Client...\n");
}


   
  
   
   
private DatabaseLog createDatabaseLog()
throws CreateException, RemoteException{
log ("Creating DatabasELog ");
DatabaseLog ac = (DatabaseLog)PortableRemoteObject.narrow(
home.create(),DatabaseLog.class);  
System.out.println("Here");
int seqNumber =77;
short managedObjectClass = 2;
long eventTime = 1;
long receivedTim

Urgent help needed

2001-05-13 Thread Sudhir M

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: Determining odd-even table rows

2001-05-13 Thread Bill Pfeiffer

Ted,

I put the jarred up copy of my RowSet tags with source on my web site
(http://home1.gte.net/pfeiffer/Download.html).  This version is just as I
mentioned before: a reworking of the ResultSet tags from the taglibs Jakarta
project.

Feel free to take what you like from this, but remember it is not geared
toward general distribution (licensing and formatting certainly are not up
to snuff).

I think there is a fit for this somewhere in the DBTags portion of the
taglibs project.  The only DBTags ResultSet tag that really makes a
distinction about the source of the data is the ResultSet tag itself.  This
should be easily modified to accomodate a RowSet derived from an external
source.

The synching of a struts form elements with a given rowset opens a lot of
questions for me.

- How do I map from a html struts form to multiple row RowSet?
- Should struts provide functionality for scrollable RowSet?
- What level of functionality supported by a RowSet can/should I provide in
mapping from a struts form to a RowSet (Insert, Delete, Modify, None of the
above)?
- Where does the line of responsibility for such logic get drawn between a
tag and an action class?

I'm sure there are a hundred more question like this, but its getting past
my bedtime.

Let me know what you think,

Bill Pfeiffer




- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 13, 2001 2:39 PM
Subject: Re: Determining odd-even table rows


> That sounds cool, Bill.
>
> I'm making extensive use of RowSets now myself. Right now, I pump the
> RowSet into a bean or collection of beans and pass that to iterate or a
> form. I use a custom constructor for the bean with a parameter for each
> property so that I can pass everything once.
>
> On the 1.1 list now is enhancing iterate to recognize RowSets (and XML)
> so that these can be used in addition to a collection of beans.
>
> In working with RowSets, I keep coming back to the idea that in practice
> my RowSets and my ActionForm beans share same properties. RowSets can
> also set and get any column as a String, which is an essential part of
> being an ActionForm bean. RowSets also have many built-in data
> conversion methods that most applications need. So it just seems to me
> that if we are going to extend iterate to support RowSets, why not
> extend the other custom tags too? Why not an ActionRowSet with a reset
> and validate method for the action to call?
>
> I haven't researched the code yet, but off-hand the real trick would
> seem to be creating a RowSet from scratch, so that it could be populated
> outside of the JDBC command. But since Cached RowSets allow you to
> create and populate columns, we should be able to do that too.
>
> The Sun documentation mentions that RowSets are suppose to be JavaBeans,
> and I did try to feed them to iterate, but it doesn't seem to work.
>
> If you would like to send me the source you have so far, perhaps we can
> work on refactoring it together.
>
> Bill Pfeiffer wrote:
> >
> > Ted,
> >
> > So far, my work with setting up a RowSet rather than a ResultSet
consists of
> > the following:
> >
> > 1. Reworking the DBTags ResultSetTag (and all nested tags) to use
> > javax.sql.RowSet instead of ResultSet.
> >
> > 2. Reworking the ResultSetTag to grab a RowSet object out of a given
context
> > (page, request, session, application), instead of relying on a parent
tag
> > generated Statement.  The idea here is that some other code (servlet,
struts
> > action, etc) will create the result set and shove it into the scoped
> > attribute.
> >
> > This doesn't really constitute much original work on my part.  But it
does
> > allow me to create the RowSet in the EJB layer.  I have created a
session
> > bean that will take a sql string, create the RowSet, and pass it back.
> >
> > I can pass this along, however, I think it would be in the best interest
of
> > the taglibs community to somehow integrate what I have with the current
> > result set implementation.  In all actuality, I don't HAVE to use a
RowSet.
> > Since RowSet implements ResultSet, I could have just modified the
ResultSet
> > tag to somehow 'know' when to use a parent Statement or get an existing
> > result set from the pageContext (which is what I do now).
> >
> > As far as struts is concerned, I would be curious to know how you would
see
> > RowSet tags integrating with it.  Is the idea that you would map or bind
a
> > struts form field to a RowSet column?
> >
> > I'll get started by joining the taglibs-dev mailing list.
> >
> > I can send you my source set for the RowSet stuff I've done, but it is
far
> > from ready for prime time.
> >
> > Let me know,
> >
> > Bill




Final WAS Install document

2001-05-13 Thread Dan Miser



This is the final revision of the WAS install 
document, based on feedback from this group. Let me know if you have any further 
comments.
--
Dan Miser
http://www.distribucon.com
WebSphere Application Server 3.5 Configuration

Server: Windows 2000 Server with WebSphere 3.5.3 Advanced
Configuring WAS 3.5

Open struts.jar with WinZip.  Extract the three DTD's (struts-config_1_0.dtd, web-app_2_2.dtd and web-app_2_3.dtd) into c:\websphere\appserver\classes, making sure you use folder names (so the files extract to classes/org/apache/struts/resources). Now WebSphere can find the DTD files with it's class loader, and there is no problem with using the SYSTEM identifier for the DTD. These files will be available to all webapps that WAS hosts with no additional effort.
For each individual webapp, you will need to put your XML files in servlets/WEB-INF or add c:\websphere\appserver\hosts\default_host\\web to the classpath. This is due to a bug in WAS, namely the class loader is not handling getResourceXXX calls properly. 
For each individual webapp, you will need to copy the 1.0.1 version of jaxp.jar and parser.jar to the servlets directory. You can find the correct version here


Deploying struts-example

Start up the adminserver. 
Start up Admin Console. 
Use the Convert War file task to convert the struts-example.war from the struts-b1 distrib as-is. 
Convert to the default_server, default servlet engine and standard install directory (c:\websphere\appserver\hosts\default_host). 
Modify your classpath for struts-example by adding c:\websphere\appserver\hosts\default_host\struts-example\web. Be sure to restart your webapp.
Alternatively: Create a WEB-INF directory in the servlets dir and copy struts-config.xml, database.xml AND web.xml into it (Keep WEB-INF with all the TLD's under web - both WEB-INF directories must be present). 
Copy jaxp 1.0.1's (NOT 1.1.1's) jaxp.jar and parser.jar to the servlets directory of the strut-example webapp. 
Click on struts-example in the Admin Console under Default Server/Default Servlet Engine and click the advanced tab on the right hand side of the screen. 
Down where it says Default Error Page, enter /ErrorReporter and then click Apply. 
Start the Default Server via the Admin Console. You should see a whole bunch of ActionServlet messages in the default_host_stdout.log file with no exceptions. 
Via a browser access the app using http://localhost/struts-example/index.jsp. 
If it returns "Application not Available" then go back to the Admin Console, right-click on struts-example and select Restart WebApp. 
Once it reports success, go back to the URL above and try again - it should work flawlessly. 


Original by: Chris Assenza and dIon Gillard
Modifications by: Dan Miser and Stephen Schaub

Re: Where are the TLD's?

2001-05-13 Thread Martin Cooper

The tlds are generated during the build process. For example,
struts-bean.xml is processed with tld.xsl to create struts-bean.tld. The
same XML document is processed with a different stylesheet to generate the
taglib documentation. This means that only the one XML file has to be
updated when a tag is added or changed.

--
Martin Cooper


- Original Message -
From: "Johan Compagner" <[EMAIL PROTECTED]>
To: "Struts" <[EMAIL PROTECTED]>
Sent: Saturday, May 12, 2001 1:24 AM
Subject: Where are the TLD's?


> Now the sources are not in the binary's anymore (i didn't check this but i
think it is true)
> I download only the sources, because that is what i really need.
>
> But i see that the sources don't contain the tld's!
> Now i still have to download the binary's also, of course you can say, why
do you care?
> But if the binary's don't contain the sources anymore, i would love to
have the
> sources contain all the resources files that is needed for struts.
>
> johan
>
>





RE: Iterate index property example?

2001-05-13 Thread Niall Pemberton

The RowTag I wrote uses it - up until 28/04/2001 you couldn't access it
(thats afte 1.0-b1), after that Craig added a getIndex() method.

You can download my RowTag from Ted Husted's site at:

http://husted.com/about/struts/

Niall

> -Original Message-
> From: David Lieberman [mailto:[EMAIL PROTECTED]]
> Sent: 13 May 2001 13:56
> To: [EMAIL PROTECTED]
> Subject: Iterate index property example?
>
>
> Can anyone send me an example for accessing the index property of the
> iterate tag?
>
> Thanks!
>
> --
>
> ___
>
> David Lieberman
> Software Engineer, Multimedia Group, ITG
> Harvard Business School
> Cotting House 317
> Boston, MA 02163
> 617.495.6389
> ___
>
>
>




RE: FW: Determining odd-even table rows

2001-05-13 Thread Niall Pemberton

Fine by me. Great job on the web site by the way.

Niall

> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: 13 May 2001 11:48
> To: [EMAIL PROTECTED]
> Subject: Re: FW: Determining odd-even table rows
> 
> 
> Cool. I've made it available for download on my Struts page, if that's
> all right. 
> 
> < http://husted.com/about/struts/ >
> 
> 
> Niall Pemberton wrote:
> > OK, its attached.
> 



Re: Determining odd-even table rows

2001-05-13 Thread Ted Husted

That sounds cool, Bill. 

I'm making extensive use of RowSets now myself. Right now, I pump the
RowSet into a bean or collection of beans and pass that to iterate or a
form. I use a custom constructor for the bean with a parameter for each
property so that I can pass everything once. 

On the 1.1 list now is enhancing iterate to recognize RowSets (and XML)
so that these can be used in addition to a collection of beans.

In working with RowSets, I keep coming back to the idea that in practice
my RowSets and my ActionForm beans share same properties. RowSets can
also set and get any column as a String, which is an essential part of
being an ActionForm bean. RowSets also have many built-in data
conversion methods that most applications need. So it just seems to me
that if we are going to extend iterate to support RowSets, why not
extend the other custom tags too? Why not an ActionRowSet with a reset
and validate method for the action to call?

I haven't researched the code yet, but off-hand the real trick would
seem to be creating a RowSet from scratch, so that it could be populated
outside of the JDBC command. But since Cached RowSets allow you to
create and populate columns, we should be able to do that too.

The Sun documentation mentions that RowSets are suppose to be JavaBeans,
and I did try to feed them to iterate, but it doesn't seem to work. 

If you would like to send me the source you have so far, perhaps we can
work on refactoring it together.

Bill Pfeiffer wrote:
> 
> Ted,
> 
> So far, my work with setting up a RowSet rather than a ResultSet consists of
> the following:
> 
> 1. Reworking the DBTags ResultSetTag (and all nested tags) to use
> javax.sql.RowSet instead of ResultSet.
> 
> 2. Reworking the ResultSetTag to grab a RowSet object out of a given context
> (page, request, session, application), instead of relying on a parent tag
> generated Statement.  The idea here is that some other code (servlet, struts
> action, etc) will create the result set and shove it into the scoped
> attribute.
> 
> This doesn't really constitute much original work on my part.  But it does
> allow me to create the RowSet in the EJB layer.  I have created a session
> bean that will take a sql string, create the RowSet, and pass it back.
> 
> I can pass this along, however, I think it would be in the best interest of
> the taglibs community to somehow integrate what I have with the current
> result set implementation.  In all actuality, I don't HAVE to use a RowSet.
> Since RowSet implements ResultSet, I could have just modified the ResultSet
> tag to somehow 'know' when to use a parent Statement or get an existing
> result set from the pageContext (which is what I do now).
> 
> As far as struts is concerned, I would be curious to know how you would see
> RowSet tags integrating with it.  Is the idea that you would map or bind a
> struts form field to a RowSet column?
> 
> I'll get started by joining the taglibs-dev mailing list.
> 
> I can send you my source set for the RowSet stuff I've done, but it is far
> from ready for prime time.
> 
> Let me know,
> 
> Bill



"is not defined as bean" error

2001-05-13 Thread Kiet Nguyen

I'm running the strut-example application within weblogic 51.  I have the
following error when I try to access a logon page.  I think it is trying to
access a bean, but it can't find.  I'm not configuring something.

Sun May 13 12:31:49 PDT 2001: 
Servlet failed with Exception
weblogic.servlet.jsp.JspException: (line 16): user is not defined as bean
at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:673)
at
weblogic.servlet.jsp.JspLexer.mXML_GET_PROPERTY(JspLexer.java:2994)



Re: Determining odd-even table rows

2001-05-13 Thread Bill Pfeiffer

Ted,

So far, my work with setting up a RowSet rather than a ResultSet consists of
the following:

1. Reworking the DBTags ResultSetTag (and all nested tags) to use
javax.sql.RowSet instead of ResultSet.

2. Reworking the ResultSetTag to grab a RowSet object out of a given context
(page, request, session, application), instead of relying on a parent tag
generated Statement.  The idea here is that some other code (servlet, struts
action, etc) will create the result set and shove it into the scoped
attribute.

This doesn't really constitute much original work on my part.  But it does
allow me to create the RowSet in the EJB layer.  I have created a session
bean that will take a sql string, create the RowSet, and pass it back.

I can pass this along, however, I think it would be in the best interest of
the taglibs community to somehow integrate what I have with the current
result set implementation.  In all actuality, I don't HAVE to use a RowSet.
Since RowSet implements ResultSet, I could have just modified the ResultSet
tag to somehow 'know' when to use a parent Statement or get an existing
result set from the pageContext (which is what I do now).

As far as struts is concerned, I would be curious to know how you would see
RowSet tags integrating with it.  Is the idea that you would map or bind a
struts form field to a RowSet column?

I'll get started by joining the taglibs-dev mailing list.

I can send you my source set for the RowSet stuff I've done, but it is far
from ready for prime time.

Let me know,

Bill


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 13, 2001 12:00 PM
Subject: Re: Determining odd-even table rows


> I'd be extremely interested in a tag that rolls through a RowSet.
>
> The Jakarta DBTags work directly with result sets. I'm not aware of any
> support for RowSets there. So, you may want to start by contributing it
> there, perhaps as an addition to the existing DBTags library.
>
> Meanwhile, providing direct support in Struts for RowSets would be a
> Very Good Thing. If we can enhance the HTML tags to work as easily with
> RowSets as they do with ActionForm beans, we could eliminate a layer of
> classes in many cases.
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/




Re: Determining odd-even table rows

2001-05-13 Thread Ted Husted

I'd be extremely interested in a tag that rolls through a RowSet. 

The Jakarta DBTags work directly with result sets. I'm not aware of any
support for RowSets there. So, you may want to start by contributing it
there, perhaps as an addition to the existing DBTags library.

Meanwhile, providing direct support in Struts for RowSets would be a
Very Good Thing. If we can enhance the HTML tags to work as easily with
RowSets as they do with ActionForm beans, we could eliminate a layer of
classes in many cases. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/



Re: Determining odd-even table rows

2001-05-13 Thread Bill Pfeiffer

Niall,

Your response got me headed in the right decision.  I have already written
my own iteration scheme that rolls through a returned RowSet.  As such, I
went ahead and wrote a tag that would return a class attribute the will
rotate through class values.  Example:

 >

where

id attribute: uniquely identifies this set of class values to rotate through
for this page (scoped within the pageContext)

classes attribute: provides a space delimited list of class values to rotate
through.  Note that even though my examples shows only two class items,
there could be any number.

The example above would yeild:

  on the first time through, and

  on the second time through

The tag is not dependant on any iteration sheme other than it expects to be
used within the scope of some type of iteration.  The tag also assumes that
the classes identified in the 'classes' attribute have been set up in a
style sheet or style tag.

If anyone thinks this would be generically useful, I'd be glad to contribute
it to the taglibs project.  If it appears to be redundant effort, I won't
bother.

Thanks for the response,

Bill Pfeiffer

- Original Message -
From: "Niall Pemberton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 6:02 PM
Subject: RE: Determining odd-even table rows


> I have a RowTag that does this, it generates  elements and you can
> specify either oddColor/evenColor attributes to generate bgcolor=
attributes
> or oddStyle/evenStyle parameters to generate class= attributes for CSS.
>
> So the jsp looks like this:
>
>   
> 
>
> .
> .
>
> 
>   
>
> You can either specify both odd and even or just one of them.
>
> I'll send it if you're interested.
>
> Niall
>
>
> > -Original Message-
> > From: Bill Pfeiffer [mailto:[EMAIL PROTECTED]]
> > Sent: 11 May 2001 20:08
> > To: Struts-User
> > Subject: Determining odd-even table rows
> >
> >
> > I'm trying to figure out how to do a green-bar effect (different
backround
> > colors for every other row of a table) with struts/jsp.  I am using a
> > tagified javax.sql.Rowset.  I can iterate through the rowset via my tags
> > (reworked jakarta DBTags).  The problem, more of a mental block,
> > is how do I
> > alternate the backround colors of the html rows I am writing WITHOUT
> > resorting to scriptlets.  I have just added a tag to get the
> > current row, so
> > I have that returing, but what do I do with it?
> >
> > The logic tags in struts deal only with comparisons to constants.
> >  I need to
> > do some math to determine whether the current row is odd/even so I can
set
> > the backround.
> >
> > Is it easier than this and I'm missing it?
> >
> > My goal here is not to do any scriplets.  I'm putting together a
> > set of tags
> > to help our web guy build pages using only tags.
> >
> > Thanks for any help,
> >
> > Bill Pfeiffer
> >
> >
>
>




Iterate index property example?

2001-05-13 Thread David Lieberman

Can anyone send me an example for accessing the index property of the
iterate tag?

Thanks!

--

___

David Lieberman
Software Engineer, Multimedia Group, ITG
Harvard Business School
Cotting House 317
Boston, MA 02163
617.495.6389
___





How to set value to radio button/check box dynamically

2001-05-13 Thread B Manikandan

Hi,
   When a form is loaded how to set the value of radio buttons/check
boxes.
I have a property in my bean whose value has to be set in radio
button/check box.

But,if I use



all that Iam getting is  a radio button with value="childGroupOID".But I
need the value of childGroupOID from bean class
DomainDomainRelationHolder as value of my radio button.

Mani







Re: FW: Determining odd-even table rows

2001-05-13 Thread Ted Husted

Cool. I've made it available for download on my Struts page, if that's
all right. 

< http://husted.com/about/struts/ >


Niall Pemberton wrote:
> OK, its attached.



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

2001-05-13 Thread B Manikandan

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