There *has* to be an easy way to do this...

2004-03-21 Thread Joe Hertz


I have a simple iterate in a piece of JSP (snippet follows) that provides an 
interface inside of an HTML table to modify items that came out of the 
database.

What I want to do is provide an extra row or two for new items to be inserted 
into the database. Short of embeddeding scriptlet code to generate the 
property identifiers (which are in a List), is there a good way to do this? 

Basically the ideal answer would be to have a way to tell logic:iterate to go 
for an extra round, with the tag being smart enough to "do the needful".

tia

-Joe



Minimum Purchase
Cost Per Credit
Begin Date
End Date










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



struts-faces.war ver 0.5

2004-03-21 Thread a s
Hi,
I am using JWSDP1.3.  As per the readme.txt file in struts-faces download, I deleted
the jsf.  I did a new download of JSF and copied to jsf of jwsdp1.3
I also performed the following
  mkdir temp
  cd temp
  jar xvf $STRUTS_FACES_HOME/webapps/struts-faces.war
  cp $JSF_HOME/lib/jsf-api.jar WEB-INF/lib
  cp $JSF_HOME/lib/jsf-impl.jar WEB-INF/lib
  jar cvf ../struts-faces.war *
  cd ..

Copied the new struts-faces.war to webapps directory of jwsdp1.3
 
I click on the registration link
I fill out the fields and click on the 'Save' button
Then I see the following in the address bar
http:///struts-faces/registration.faces
 
localhost:8080 is not there in about address bar
 
what ami missing
 
-Aswath
 
 
 
 
 
 
 
 

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: off-theme question: about getServletConfig and getServeletContext

2004-03-21 Thread Craig R. McClanahan
Quoting Mu Mike <[EMAIL PROTECTED]>:

> does the servlet container has only one servletcontext instance for all the 
> servlets it manages? and the same to servletconfig instance?
> 

There is one ServletContext instance for each web application (which can
encompass many servlets and JSP pages).  There is one ServletConfig instance
for each servlet.

Craig


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



off-theme question: about getServletConfig and getServeletContext

2004-03-21 Thread Mu Mike
does the servlet container has only one servletcontext instance for all the 
servlets it manages? and the same to servletconfig instance?

Thanks&Regards

_
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com  

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


Re: [OT] Object Design Question

2004-03-21 Thread Pedro Salgado
On 12/03/2004 21:26, "Avinash Gangadharan" <[EMAIL PROTECTED]> wrote:

> People,
>   I have a design question. It is regarding the retrieval of parent and
> child objects in the best possible manner. For eg. Let's say there is a
> Person object with properties such as ssn, lastName and firstname. It also
> has a list child objects ( "Address" ) of addresses and a list of previous
> employees ( "Employee" ). The Person, Address and Employee objects are
> separate tables in the DB linked thru ssn.
> Now what do you guys think is the most efficient way of retrieving a
> complete Person. 

  If you're talking about SQL, can't you issue one or two SQL queries (with
subselects, inner or outer joins) or write a stored procedure to retrieve
all the info? (I am used to work with MySQL so my advanced SQL is a bit
rusty)


  Continuing with simple SQL queries only... You could do this in a 2 step
mode:
  - retrieve all persons who have addresses and employees (1 query per
person)
  - for the remaining people (1-2 queries per person)
- get the addresses (select... where person.ssn = address.ssn and id <>
...) (1 query per person)
- get the employees (similar to the previous case) (1 query per person)

  (anyway you get 3 full table search)
  If you had to had 2 flags on the Person - hasAddresses and hasEmployees -
you could make the queries more simple - fetch for (1-1), (1-0) and (0-0) -
but maybe it would be more difficult to maintain.

  If you are talking about a persistence layer (like OJB - see ojb-user
mailing list) some of them have lazy loading: it only loads the Person
collection of Addresses only if you use them.
  This will certainly be simpler... And if you have object cache it could
even things up (maybe you could issue a great number SQL queries but if the
objects were already in cache then there would be no need for any SQL
query).

> 
> The simplest way is ofcourse issue 3 queries one for person, other for the
> list of address and the third for previous employees. But this does not
> scale well with increasing size of the table data. For 100 rows of Person
> 201 queries are issued. 1 which gets 100 persons, 100 each for there
> subequent address and previous employees. Similarly for a 1000,  2001
> queries. 
> 
> Complex queries may be a solution which relies on filtering the resultset
> but is there a more simple and intelligent approach.
> 
> Is there a problem with the inherent design itself or is this a common
> problem.

  I don¹t see any problem on the design itself (well maybe... it seems you
have the social security number has the primary key... pks are not supposed
to have any real meaning -> what would happen if all of the social security
numbers were to be changed? It would generate a huge number of cascade
updates. Do whatever you like maybe I am raising a false issue here).


  Hope it helps,

Pedro Salgado

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


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



Validation Question with Indexed Properties

2004-03-21 Thread Craig Tataryn
Hi, I have the following definition in my validation.xml file:









I then have a form that is built like so:
<% addressIndex = "address(" + region.getKey() + ")"; %>

.
.
.


This generates HTML that looks like:


.
.
.


However, if I look at the javascript generated by , I find:

 var bCancel = false; 

function validateMarketAddressForm(form) { 
 

if (bCancel) 
  return true; 
else 
   return validateRequired(form); 
   } 

function required () { 
} 

So does this mean that indexed properties for the validator do not work in javascript? 
 Or am I
doing something wrong?

Thanks,

Craig





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



Re: multiple lines in an ActionMessage object displayed via javascript alert

2004-03-21 Thread Mark Lowe
What characters have you in your strings ?

There must be something a quote or something give js a bad day.

I assume you've something like this.

msg1 = "";
msg2 = "";
msg3 = "";
msg = msg1 +"\n"+ msg2 +"\n"+ msg3;
alert(msg);
Paste the rendered source in to a reply and I'm sure one or more of you 
messages has a character that needs escaping or something like that.

On 22 Mar 2004, at 00:17, Just Fun 4 You wrote:

 Hi,

I create an ActionMessages object and store one ActionMessage in it. 
The
ActionMessage is a string which contains the \n character
to display the whole message in more than one line:

message1\nmessage2\nmessage3...

In my jsp I have defined the html:message for iteration within a 
javascript
block as I would like to display the message by the javascript alert
function.

The problem is, that I always get a javascript error for the \n 
character
(unterminated string constant). However, if I remove the \n character
everything works. But then, the whole message is displayed in one 
line. Can
someone help?

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


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


multiple lines in an ActionMessage object displayed via javascript alert

2004-03-21 Thread Just Fun 4 You
 
 Hi,

I create an ActionMessages object and store one ActionMessage in it. The
ActionMessage is a string which contains the \n character 
to display the whole message in more than one line:

message1\nmessage2\nmessage3...


In my jsp I have defined the html:message for iteration within a javascript
block as I would like to display the message by the javascript alert
function. 

The problem is, that I always get a javascript error for the \n character
(unterminated string constant). However, if I remove the \n character
everything works. But then, the whole message is displayed in one line. Can
someone help?

thx,
Dirk 


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



Slightly OT: Looking for talent

2004-03-21 Thread Todd Grigsby
I'm posting this message to this forum because it's a Struts email list.  If you 
live in or near Manteca, CA, and you're an expert with Java and Struts, as well 
as having experience with Borland Delphi and SQL database programming, write me. 
 I'm starting a company and I'm looking for some talented folks in my general 
location. You can contact me at [EMAIL PROTECTED]

Todd Grigsby



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


RE: Does instanceof work?

2004-03-21 Thread Steve Raeburn
An instanceOf tag does exist in the Jakarta Taglibs 'Unstandard' taglib.

http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/intro.html

That's the only place I know of.

Steve

> -Original Message-
> From: Joe Germuska [mailto:[EMAIL PROTECTED]
> Sent: March 21, 2004 6:33 AM
> To: Struts Users Mailing List
> Subject: Re: Does instanceof work?
>
>
> At 1:31 PM + 3/21/04, Frank Burns wrote:
> >I've tried the Struts logic and the JSTL tag version of
> instanceof, like
> >these (below), but get errors returned implying that
> instanceof doesn't
> >exist as a valid option.
> >Does it exist? Am I doing something wrong? Can someone give
> me an example,
> >please?
>
> As far as I know, it simply doesn't exist.  The full array of tags in
> the Struts logic taglib (from CVS HEAD) can be found at
> http://jakarta.apache.org/struts/userGuide/struts-logic.html   (For
> older versions of struts, consult the documentation included in the
> distribution, although I don't recall any major changes happening in
> this area recently.)
>
> As for the JSTL expression language, I've never seen reference to an
> "instanceof" operator.  Note that the expression language is not
> simply  "${any java you like}"  Here's one reference to consult:
>
> http://www.manning-source.com/books/bayern/bayern_apxA.pdf
>
> If you really wanted, you could probably extend ConditionalTagBase
> and implement your own.
> http://jakarta.apache.org/struts/api/org/apache/struts/taglib/
logic/ConditionalTagBase.html

Joe

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
   "Imagine if every Thursday your shoes exploded if you tied them
the usual way.  This happens to us all the time with computers, and
nobody thinks of complaining."
 -- Jef Raskin

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





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



CDManager sample in the book "The Struts Framework"

2004-03-21 Thread Johnson Leung
Hi All,

I am new to Struts, and just start to learn it.

I bought the book "The Struts Framework" and downloaded their sample
application. However, whenever I tried to retrieve (or save) records
from the database, I encountered the following error in the log. I am
using J2SE instead of J2EE. Do you think it is causing the problem? If
not, can someone help to point out what's wrong?
Thanks a lot,
Johnson
[EMAIL PROTECTED]
2004-03-21 09:28:43 StandardContext[/sonic]action: Initializing
application data source org.apache.struts.action.DATA_SOURCE
2004-03-21 09:29:13 StandardWrapperValve[cdmanager]: Servlet.service()
for servlet cdmanager threw exception
java.lang.NullPointerException
   at cdmanager.actions.InsertAction.execute(Unknown Source)
   at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446) 

   at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) 

   at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) 

   at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) 

   at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257) 

   at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) 

   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245) 

   at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199) 

   at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) 

   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184) 

   at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) 

   at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164) 

   at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149) 

   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156) 

   at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) 

   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
   at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
   at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
   at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732) 

   at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
   at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688) 

   at java.lang.Thread.run(Thread.java:534)

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


Re: Webb access to mailing list

2004-03-21 Thread Craig R. McClanahan
Quoting tiredcasper <[EMAIL PROTECTED]>:

> yes,if there is a newsgroup ,things will be better.

Among other places, you can get a newsgroup mirror of STRUTS-USER (and lots of
other interesting lists) at .

Craig


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



RE: security framework!!!

2004-03-21 Thread Craig R. McClanahan
(Jumping in late, and trying to catch up on several hundred email messages in my
STRUTS-USER folder, but better late than never ...)

Quoting David Friedman <[EMAIL PROTECTED]>:

> Adam,
> 
> With my structure, I might have to become a particular reseller, then flip
> into a customer of his/hers, then become one of their client accounts to
> look into a reported problem.  I worry about login identities for the
> following reasons:
> 
> Using a JAAS login, my principal would be fixed (set in stone) for my
> session.  Then, I couldn't be able to use the 'roles' settings inside
> Struts, Tiles, and JSPs to control content.
> 
> Without using a JAAS login, I also become unable to use 'roles' in Tiles and
> JSPs to control content.
> 
> Without having any theories on how to successfully (and without much
> alteration to the package[s]) use roles for Struts, Tiles, and JSPs, I'm at
> a loss how to change my identity/roles
> 
> If I made a filter to wrapper the Request with a HTTPServletRequestWrapper
> object then added my own push/pop/depth methods, I see how I could use roles
> in all of those places.
> 
> Knowing all of the above gory details, do you (or anyone) have any
> suggestions on how to make things cleaner while using roles in all of those
> places with the various levels of control I need to exert (albeit probably
> rarely switching roles) ?
> 

David,

If I understand what you're after correctly, the design you have proposed is
pretty troubling from a security perspective.  In particular, consider what
happens if your system is also logging who made what changes (so you can go
audit things later).  If users are allowed to impersonate each other, you have
no accountability at all.  From a security perspective, it is much better that
each user have a unique individual identity, and that all actions taken by that
individual are associated with that identity.

Going back to your problem, then, have you considered that an individual user
can have more than one role?  For example, if you have "manager" and "employee"
roles, you (as a manager) can have *both* of them assigned to your
UserPrincipal, and therefore you can do anything that either a "manager" or an
"employee" can do, while employees cannot execute manager functions.  This is
the way roles are typically used in J2EE applications, and it maps just as well
to your five-level hierarchy as it does a two-level one.

> Thanks (to all) for any constructive suggestions,
> David

Craig McCanahan



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



RE: Bean:write

2004-03-21 Thread as as
Thanks Robert,w ill try this now..
Has anyone also used graphing software (jfree) with struts...
looking for a open source implemntation on the same...
 
Thanks!

Robert Taylor <[EMAIL PROTECTED]> wrote:
Try using the following with JSTL:



or you can try the following using 




If you are still getting a error make sure you are
using proper JavaBean naming conventions. You can find this in
the JavaBean specification.

robert

> -Original Message-
> From: as as [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 21, 2004 12:47 PM
> To: Struts Users Mailing List
> Subject: Bean:write
> 
> 
> 
> Hi,
> 
> 
> 
> In my logic:iterate tag, I want to pull out the value of the bean:write tag.
> 
> I am using following syntax.
> 
> something is probably wrong, as i am getting a compile error.
> 
> looking for right syntax
> 
> basically all i want to to is pull out the value of the bean:write tag.
> 
> 
> 
> Thanks in advance.
> 
> 
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

RE: Bean:write

2004-03-21 Thread Robert Taylor
Try using the following with JSTL:



or you can try the following using 




If you are still getting a error make sure you are
using proper JavaBean naming conventions. You can find this in
the JavaBean specification.

robert

> -Original Message-
> From: as as [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 21, 2004 12:47 PM
> To: Struts Users Mailing List
> Subject: Bean:write
> 
> 
> 
> Hi,
> 
>  
> 
> In my logic:iterate tag, I want to pull out the value of the bean:write tag.
> 
> I am using following syntax.
> 
> something is probably wrong, as i am getting a compile error.
> 
> looking for right syntax
> 
> basically all i want to to is pull out the value of the bean:write tag.
> 
>  
> 
> Thanks in advance.
> 
> <% java.lang.String myValue = ;.
> 
>  
> 
>  
> 
> 
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.

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



Bean:write

2004-03-21 Thread as as

Hi,

 

In my logic:iterate tag, I want to pull out the value of the bean:write tag.

I am using following syntax.

something is probably wrong, as i am getting a compile error.

looking for right syntax

basically all i want to to is pull out the value of the bean:write tag.

 

Thanks in advance.

<% java.lang.String myValue = ;.

 

 


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: [OT] 2 JSF questions

2004-03-21 Thread Craig R. McClanahan
(Better late than never ...)

Quoting "Anderson, James H [IT]" <[EMAIL PROTECTED]>:

> 1) Since JSF is written in Java, why does Sun have 3 different download
> available, Windows, Solaris, Linux?
> 

There are OS-specific downloads of the JDK itself, because the native code
inside is different for each platform.  There are platform specific versions of
the J2EE SDK because the installer is unique to each platform  But there is
only one download of the JavaServer Faces reference implementation:

  http://java.sun.com/j2ee/javaserverfaces/download.html

> 2) Would any of those work for Mac OS X?
> 

Yes.

> Thanks,
> 
> jim
> 

Craig


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



Re: Does instanceof work?

2004-03-21 Thread Joe Germuska
At 1:31 PM + 3/21/04, Frank Burns wrote:
I've tried the Struts logic and the JSTL tag version of instanceof, like
these (below), but get errors returned implying that instanceof doesn't
exist as a valid option.
Does it exist? Am I doing something wrong? Can someone give me an example,
please?
As far as I know, it simply doesn't exist.  The full array of tags in 
the Struts logic taglib (from CVS HEAD) can be found at 
http://jakarta.apache.org/struts/userGuide/struts-logic.html   (For 
older versions of struts, consult the documentation included in the 
distribution, although I don't recall any major changes happening in 
this area recently.)

As for the JSTL expression language, I've never seen reference to an 
"instanceof" operator.  Note that the expression language is not 
simply  "${any java you like}"  Here's one reference to consult:

http://www.manning-source.com/books/bayern/bayern_apxA.pdf

If you really wanted, you could probably extend ConditionalTagBase 
and implement your own.
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/logic/ConditionalTagBase.html

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
-- Jef Raskin

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


Re: Does instanceof work?

2004-03-21 Thread Larry Meadors
Neither are valid:

http://jakarta.apache.org/struts/api/org/apache/struts/taglib/logic/package-summary.html

According to the jstl doc I have, instanceof is reserved, but not
implemented.

If you are not concerned about subclasses of "foo.MyType", you could
probably use this:


 ...



Larry

>>> [EMAIL PROTECTED] 03/21/04 6:31 AM >>>
I've tried the Struts logic and the JSTL tag version of instanceof, like
these (below), but get errors returned implying that instanceof doesn't
exist as a valid option.
Does it exist? Am I doing something wrong? Can someone give me an
example,
please?

Thanks,
Frank.

*** examples ***


 ...




 ...



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



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



Does instanceof work?

2004-03-21 Thread Frank Burns
I've tried the Struts logic and the JSTL tag version of instanceof, like
these (below), but get errors returned implying that instanceof doesn't
exist as a valid option.
Does it exist? Am I doing something wrong? Can someone give me an example,
please?

Thanks,
Frank.

*** examples ***


 ...




 ...



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



Re: WAS: problems with - Help Please - ActionServlet fails on startup

2004-03-21 Thread Craig R. McClanahan
Quoting Lukas Latz <[EMAIL PROTECTED]>:

> Is there a problem with using Tomcat 3.23 and Struts 1.1 ?

Yes, there is.  Tomcat 3.2.x has many bugs with the way that class loading is
handled that make it totally unsuitable for Struts 1.1 applications.  You
should upgrade to a more current Tomcat release -- if you want realistic
support, then I'd recommend upgrading to the most recent Tomcat 5.0.x stable
release.

Craig McClanahan


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