Re: Shopping Cart

2005-05-29 Thread Rafael Taboada
 Ok, I decided to work with the session context. But I have a problem I 
don't know how to solve it.
  I have a form, inside there's a submit button but there are some buttons 
in order to do extra function like add a new item to the form.
  My problem is I don't how to store in my action the data that the user has 
filled before to press another button different to submit button.
  Because when the user press the submit button, the action receive the form 
and i can work with the data, but how can i know if the user is 
prepopulating extra data before press the submit button?
  I have some link buttons that they do some extra functions inside the 
form...
  Can u know??


-- 
Rafael Taboada
Cell : 511-97753290

No creo en el destino pues no me gusta tener la idea de controlar mi vida


Action class defined in action-mappings not being executed - without 2mb webapp source

2005-05-29 Thread Robbie Anonymous
Hi,

The Action class defined in my action-mappings not being executed.
I know its not being executed as I made the execute window pop up a 
swing window on the server
and it did not.
When I click submit on contactUs.jsp, instead of an object 
com.devfirm.actions.AddContactUs being instantaniated and
having its execute() method called, nothing happens and I get sent 
to a blank page.
I have attatched the full code of my web app.

below is my struts-config.xml
?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;


struts-config
 data-sources
 /data-sources

 form-beans
 form-bean  name=contactUs
 type=com.devfirm.formbeans.ContactUs
 /form-bean
 /form-beans

 global-exceptions
 /global-exceptions

 global-forwards
 /global-forwards

 action-mappings
 action
 path=/addContactUs
 type=com.devfirm.actions.AddContactUs
 name=contactUs
 validate=false
 input=/contactUs.jsp
 forward
 name=failure
 path=/contactUs.jsp/
 forward
 name=success
 path=/contactUs.jsp/
 /action
 /action-mappings

 message-resources  parameter=ApplicationResources/
/struts-config

Regards,
Robbie


-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


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



RE: Action class defined in action-mappings not being executed - without 2mb webapp source

2005-05-29 Thread David G. Friedman
Robbie,

I see you are using Struts v1.1 (your included DTD lists it as such) so are
you using execute() or perform()?  What is your Action method's signature?

Regards,
David



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



RE: Action class defined in action-mappings not being executed - without 2mb webapp source

2005-05-29 Thread Robbie Anonymous
I fixed the dtd to be struts 1.2 as thats the version of my struts.jar (Struts 
1.2.4).
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.2//EN
  http://struts.apache.org/dtds/struts-config_1_2.dtd;
still doesnt work.

I'm using an execute() method and the code (along with method signature) is 
below

/*
 * AddContactUs.java
 *
 * Created on May 26, 2005, 10:24 AM
 */

package com.devfirm.actions;

import org.apache.struts.action.*;
import javax.servlet.*;
import com.devfirm.services.*;
import com.devfirm.formbeans.*;
/**
 *
 * @author Robbie
 */
public class AddContactUs extends Action{

/** Creates a new instance of AddContactUs */
public AddContactUs() {
}

public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception {
//Message.showInfo(Contact Us Action is Running);
ActionForward forward = null;
ContactUsService service = new ContactUsService();
try {
service.add(form);
return mapping.findForward(success);
}catch(Exception e) {
return mapping.findForward(failure);
}
}
}

struts-config.xml : 
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.2//EN
  http://struts.apache.org/dtds/struts-config_1_2.dtd;
struts-config
data-sources
/data-sources

form-beans
form-bean  name=contactUs
type=com.devfirm.formbeans.ContactUs
/form-bean
/form-beans

global-exceptions
/global-exceptions

global-forwards
/global-forwards

action-mappings
action
path=/addContactUs
type=com.devfirm.actions.AddContactUs
name=contactUs
validate=false
input=/contactUs.jsp
forward 
name=failure 
path=/contactUs.jsp/
forward 
name=success 
path=/contactUs.jsp/
/action
/action-mappings

message-resources  parameter=ApplicationResources/
/struts-config

ContactUs.java:
*
 * ContactUs.java
 *
 * Created on May 25, 2005, 11:30 PM
 */

package com.devfirm.formbeans;
import org.apache.struts.action.*;
/**
 *
 * @author Robbie
 */
public class ContactUs extends ActionForm {

/** Creates a new instance of ContactUs */
public ContactUs() {
//Message.showInfo(Contact Us Instantaniated);
}

private String companyName;
private String contactName;
private int contactPhone;
private String contactEmail;
private String industry;
private String message;
private String foundUsVia;

public String getCompanyName() {
return companyName;
}

public void setCompanyName(String companyName) {
this.companyName = companyName;
}

public String getContactName() {
return contactName;
}

public void setContactName(String contactName) {
this.contactName = contactName;
}

public int getContactPhone() {
return contactPhone;
}

public void setContactPhone(int contactPhone) {
this.contactPhone = contactPhone;
}

public String getContactEmail() {
return contactEmail;
}

public void setContactEmail(String contactEmail) {
this.contactEmail = contactEmail;
}

public String getIndustry() {
return industry;
}

public void setIndustry(String industry) {
this.industry = industry;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public String getFoundUsVia() {
return foundUsVia;
}

public void setFoundUsVia(String foundUsVia) {
this.foundUsVia = foundUsVia;
}

}

- Original Message -
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Subject: RE: Action class defined in action-mappings not being executed - 
without 2mb webapp source
Date: Sun, 29 May 2005 03:15:07 -0400

 
 Robbie,
 
 I see you are using Struts v1.1 (your included DTD lists it as such) so are
 you using execute() or perform()?  What is your Action method's signature?
 
 Regards,
 David
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


-
To 

Re: Struts and iBatis

2005-05-29 Thread James Mitchell
From another post, someone mentioned that he is on vacation.  I'm sure he'll 

be back soon and get the tutorials back online.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]




- Original Message - 
From: Subbiah [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Sunday, May 29, 2005 1:36 AM
Subject: Struts and iBatis



Hi,
I have started working in Struts and planned to use Struts and iBatis. I
actually studied Struts thru Reumann's site and when I was abt to use 
iBatis

in my sample app, his site was down. I want to know

- if there are any good tutorials for iBatis and Struts.
- Any idea when the site might be up

Thanks.
regards,
Subbiah





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



Re: DynaActionForm and the 'pull' model

2005-05-29 Thread Ted Husted
On 5/28/05, Laurie Harper [EMAIL PROTECTED] wrote:
 Thanks for the reference Craig; but unless I'm mis-reading you, that
 still leaves me with data lookup 'hard coded' in Java classes. My goal
 is to be able to change a page's data requirements without
 recompilation. 

If it would be OK to edit an XML configuration in concert with the
page, then the Chain of Responsiblity might be useful. Each page can
have a view command, which can be a chain of commands. When the data
requirements of the page changes, the chain's configuration can be
updated to add or subtract commands. Each command can be responsible
for generating the content of a given control. The action just runs
the chain and exposes the context to the page. If the chain changes,
the context changes, but the Java code remains the same.

Between iBATIS and Chain, we are able to make very significant changes
to the content of a page, without touching the actual source code,
just the XML configuration.

-Ted.

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



Re: [OT] Business Layer Ideas

2005-05-29 Thread Ted Husted
On 5/27/05, Duong BaTien [EMAIL PROTECTED] wrote:
 We use Chain of Responsibility (CoR) implemented by commons-chain and
 its Agility to construct a Request/Response framework to connect a
 request to its designated service, whether the designated service is in
 a web-application service container, a portlet container, auth for
 authentication/authorization, or a Jcr container. 

I'm also finding that, for my applications, a service orientated
architecture based on a Chain of Responsibility works quite well. I've
started work on a framework that pushes a lot of what we do now in
Struts into the business layer. It's in C# now, because that what we
are using at work, but it's all plain old objects and should be an
easy port back to Java.

* http://wiki.apache.org/struts/StrutsOverDrive

We're using a nearly-complete prototype at work, so I've a good handle
on where this is going. It's just hard to find the time to clean it up
for public consumption :)

The essential idea is that the presentation tier should focus on
collecting and display values, and leave the rest to the business
layer. Right now, a lot of us slide down a slipperly slope that pushes
too much code into the presentation layer, where it is difficult to
test. And, by test, I really mean share with other presentation
layers. Unit tests are a presentation layer too :)

-Ted.

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



Re: Struts and iBatis

2005-05-29 Thread Larry Meadors
If you want to talk live to rick, he should be back on IRC shortly -
the server is irc.darkmyst.org, and you want to join the
#funkycodemonkey channel.

BTW, there is also a #ibatis channel where you can get help, too (same server).

Larry


On 5/28/05, Subbiah [EMAIL PROTECTED] wrote:
 Hi,
 I have started working in Struts and planned to use Struts and iBatis. I
 actually studied Struts thru Reumann's site and when I was abt to use iBatis
 in my sample app, his site was down. I want to know
 
 - if there are any good tutorials for iBatis and Struts.
 - Any idea when the site might be up
 
 Thanks.
 regards,
 Subbiah
 


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



Re: DynaActionForm and the 'pull' model

2005-05-29 Thread Dakota Jack
This is a long thread, so it might be worth repeating that Laurie
wants her (human) clients to be able to write Java code on the JSP
page.  She seems to call this data pulling.

On 5/29/05, Ted Husted [EMAIL PROTECTED] wrote:
 On 5/28/05, Laurie Harper [EMAIL PROTECTED] wrote:
  Thanks for the reference Craig; but unless I'm mis-reading you, that
  still leaves me with data lookup 'hard coded' in Java classes. My goal
  is to be able to change a page's data requirements without
  recompilation.
 
 If it would be OK to edit an XML configuration in concert with the
 page, then the Chain of Responsiblity might be useful. Each page can
 have a view command, which can be a chain of commands. When the data
 requirements of the page changes, the chain's configuration can be
 updated to add or subtract commands. Each command can be responsible
 for generating the content of a given control. The action just runs
 the chain and exposes the context to the page. If the chain changes,
 the context changes, but the Java code remains the same.
 
 Between iBATIS and Chain, we are able to make very significant changes
 to the content of a page, without touching the actual source code,
 just the XML configuration.
 
 -Ted.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

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



RE: Action class defined in action-mappings not being executed - without 2mb webapp source

2005-05-29 Thread David G. Friedman
Robbie,

Your execute() signature seems incorrect.  You use ServletRequest and
ServletResponse.  Try using HttpServletRequest and HttpServletResponse as
per the API.  The one you are using is not the default execute()
implementation for a web server.  See the descriptions of both execute()
methods on the Struts JavaDocs at:

http://struts.apache.org/api/org/apache/struts/action/Action.html

public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 javax.servlet.ServletRequest request,
 javax.servlet.ServletResponse response)
  throws java.lang.Exception

The javadoc's note reads:

The default implementation attempts to forward to the HTTP version of this
method.

As for your DTD issues: your DTD looks correct according to what is written
in the top of the 1.2 DTD but my my copy of the Struts v1.2.4 blank/example
webapp's WEB-INF/struts-config.xml, lists an alternative DTD for 1.2.4 of:

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.2//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd;

Regards,
David (off to work for the next 14 hours)

-Original Message-
From: Robbie Anonymous [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 29, 2005 6:52 AM
To: Struts Users Mailing List
Subject: RE: Action class defined in action-mappings not being executed
- without 2mb webapp source


I fixed the dtd to be struts 1.2 as thats the version of my struts.jar
(Struts 1.2.4).
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration
1.2//EN
  http://struts.apache.org/dtds/struts-config_1_2.dtd;
still doesnt work.

I'm using an execute() method and the code (along with method signature) is
below

/*
 * AddContactUs.java
 *
 * Created on May 26, 2005, 10:24 AM
 */

package com.devfirm.actions;

import org.apache.struts.action.*;
import javax.servlet.*;
import com.devfirm.services.*;
import com.devfirm.formbeans.*;
/**
 *
 * @author Robbie
 */
public class AddContactUs extends Action{

/** Creates a new instance of AddContactUs */
public AddContactUs() {
}

public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception {
//Message.showInfo(Contact Us Action is Running);
ActionForward forward = null;
ContactUsService service = new ContactUsService();
try {
service.add(form);
return mapping.findForward(success);
}catch(Exception e) {
return mapping.findForward(failure);
}
}
}

struts-config.xml :
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration
1.2//EN
  http://struts.apache.org/dtds/struts-config_1_2.dtd;
struts-config
data-sources
/data-sources

form-beans
form-bean  name=contactUs
type=com.devfirm.formbeans.ContactUs
/form-bean
/form-beans

global-exceptions
/global-exceptions

global-forwards
/global-forwards

action-mappings
action
path=/addContactUs
type=com.devfirm.actions.AddContactUs
name=contactUs
validate=false
input=/contactUs.jsp
forward
name=failure
path=/contactUs.jsp/
forward
name=success
path=/contactUs.jsp/
/action
/action-mappings

message-resources  parameter=ApplicationResources/
/struts-config

ContactUs.java:
*
 * ContactUs.java
 *
 * Created on May 25, 2005, 11:30 PM
 */

package com.devfirm.formbeans;
import org.apache.struts.action.*;
/**
 *
 * @author Robbie
 */
public class ContactUs extends ActionForm {

/** Creates a new instance of ContactUs */
public ContactUs() {
//Message.showInfo(Contact Us Instantaniated);
}

private String companyName;
private String contactName;
private int contactPhone;
private String contactEmail;
private String industry;
private String message;
private String foundUsVia;

public String getCompanyName() {
return companyName;
}

public void setCompanyName(String companyName) {
this.companyName = companyName;
}

public String getContactName() {
return contactName;
}

public void setContactName(String contactName) {
this.contactName = contactName;
}

public int getContactPhone() {
return contactPhone;
}

public void setContactPhone(int contactPhone) {
this.contactPhone = contactPhone;
}

public String getContactEmail() {
return contactEmail;

RE: Security in Struts

2005-05-29 Thread tarek.nabil
Hi Eddie,

Thanks a lot for such an enlightening explanation.

-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 28, 2005 10:01 PM
To: Struts Users Mailing List
Subject: Re: Security in Struts

Tarek,

Java provides a standard mechanism for you to tell if the person
accessing your application has a certain permission.  This is available
through request.isUserInRole(String).  Unfortunately, that only works
for Container-Managed Authentication (CMA).  You can make it work
without using CMA, but it takes a little (not too much) work.

Firstly, a Filter instance that is mapped to all your actions (and JSPs
if you access them directly and they need security).  This filter is
really simple - if the user isn't authenticated, it sends them to the
login page. 
If they are authenticated, the filter lets them pass through.  There is
one additional responsibility that I'll address later.

Your login process authenticates your users and puts a bean out in the
session to indicate the person is logged in - which is how your Filter
knows they are logged in.  I would recommend to you that the class for
this bean implement java.security.Principal, since you can then use
request.getUserPrincipal() to retrieve your bean (caveat later).  Your
login process will, additionally, determine the permissions that the
person logging in has and make those available somehow in the session
(my user bean actually stores these).

Now, the caveat I spoke of:

To make request.getUserPrincipal() and request.isUserInRole(String)
work, you're going to have to write an HttpServletRequestWrapper
implementation. 
This is very straight-forward and shouldn't take long.  What you do here
is to implement getUserPrincipal() to return the user bean after having
retrieved it from the session - under the key you bound it to in your
login process.  Piece of cake!  You'll also overload
isUserInRole(String) to retrieve the users roles and determine if the
passed-in parameter is in their list of roles.  Again - piece of cake!

Your Filter's additional responsibility:

Before calling doChain(request, response), you'll want to wrap the
request with an instance of your request wrapper.  This is the trick
(aka Magic!) that makes your application able to use standard methods
available on the request.

It sounds kind of cumbersome - complex, even - but once you start down
the road, you'll soon see that it isn't much work at all.  You *might*
spend a day on all of this - two or three if you're totally unfamiliar
with everything I've spoken about and have to do some research.  This is
- far and above - the best approach, but there's actually one better, if
you can use it:

http://securityfilter.sourceforge.net

Essentially, the security filter project does what I just said you
needed to do, but it doesn't provide database access to all RDBMS yet.
Depending on how closely you want to simulate CMA and depending on if
they have an adapter for your RDBMS, you might be better off
implementing what I spoke of above yourself.  For me, I wanted to see
what role a person had inside of an action.  It was easier for me to
grow my own than write an adapter and have to learn how to use
SecurityFilter.  That may not be the case for you.

Hope that helps!

Eddie Bush

- Original Message -
From: tarek.nabil [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, May 25, 2005 5:12 AM
Subject: Security in Struts


Hi everyone,

We're building a project using Struts and are about to start on the
security module. The requirements are that security should be fine
grained, which means that it can not be on the module level, but rather
on the JSP or Action level. Actually, the users might ask for security
on the button level, but we intend to push back on that one.

Are there any widely used approaches or best practices that we can
follow?

Note that we will not be using J2EE based authentication and security,
which means we have a custom login process.

Any suggestions are appreciated.

Thanks

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



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0521-4, 05/27/2005
Tested on: 5/28/2005 1:00:50 PM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com




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



Re: Action class defined in action-mappings not being executed - without 2mb webapp source

2005-05-29 Thread Martin Gainty

Rob
validation would be my first guess but I see you have that set to false
remember that you need to validate the form bean properties as needed and 
anything in the request

then it finds the ActionForward
Are you able to access the JSPs defined in 'success' and 'failure' 
independently

What does the logs say?
Martin-
- Original Message - 
From: Robbie Anonymous [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Sunday, May 29, 2005 3:01 AM
Subject: Action class defined in action-mappings not being executed - 
without 2mb webapp source



Hi,

The Action class defined in my action-mappings not being executed.
I know its not being executed as I made the execute window pop up a
swing window on the server
and it did not.
When I click submit on contactUs.jsp, instead of an object
com.devfirm.actions.AddContactUs being instantaniated and
having its execute() method called, nothing happens and I get sent
to a blank page.
I have attatched the full code of my web app.

below is my struts-config.xml
?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;


struts-config
data-sources
/data-sources

form-beans
form-bean  name=contactUs
type=com.devfirm.formbeans.ContactUs
/form-bean
/form-beans

global-exceptions
/global-exceptions

global-forwards
/global-forwards

action-mappings
action
path=/addContactUs
type=com.devfirm.actions.AddContactUs
name=contactUs
validate=false
input=/contactUs.jsp
forward
name=failure
path=/contactUs.jsp/
forward
name=success
path=/contactUs.jsp/
/action
/action-mappings

message-resources  parameter=ApplicationResources/
/struts-config

Regards,
Robbie


--
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.

http://datingsearch.lycos.com


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


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



Re: Newbie Question : Session Management without cookies

2005-05-29 Thread Mark Breitner
Hi - thanks for your answer. I am looking for a way to let strtuts
automatically rewrite the urls. But in the book I am reading right now I
can´t find any hint on how to do this.

Can you tell me how to rewrite the urls, so that user / pwd are send with ?

Bye,

Mark Breitner


 --- Ursprüngliche Nachricht ---
 Von: Dave Newton [EMAIL PROTECTED]
 An: Struts Users Mailing List user@struts.apache.org
 Betreff: Re: Newbie Question : Session Management without cookies
 Datum: Fri, 27 May 2005 11:12:59 -0400
 
 Nils Liebelt wrote:
 
 Have a look at J2ee Specs first. So you get an idea of the session
 concept. 
   
 
 -Original Message-
 From: Mark Breitner [mailto:[EMAIL PROTECTED] 
 Sent: Friday, May 27, 2005 4:34 PM
 Subject: Newbie Question : Session Management without cookies
 
 I just started with struts and wanted to implement an application that is
 able to do session management (f.e. user + password) even if the user has
 turned cookies off.
 
 what is the best way to do this ?
   
 
 Also look at URL rewriting, which Struts supports.
 
 Dave
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

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



Re: Using html:options tag with a Map

2005-05-29 Thread Wendy Smoak

From: Eric C. Hein [EMAIL PROTECTED]
...it looks like the list is being pulled from the map like I want it to, 
but instead of the actual list being used as collection to iterate, the 
tag lib is calling toString() on the list, and looking for a bean under 
that name.


Okay, I gave up and read the documentation ( 
http://struts.apache.org/userGuide/struts-html.html#options ) which says 
that 'collection' is the Name of the JSP bean (in some scope) which is 
itself a Collection of other beans.  Instead of having collection evaluate 
to the actual List, it needs to be the _name_ of the List.


I went back and looked at my projects, and sure enough, I have no 
expressions in the 'collection' attribute.  Unfortunately, if your List is 
inside a Map, it doesn't really have a name.  You can use c:set to name 
it.  (And this time, I tested the code.  Sorry for the earlier incorrect 
example!)


   c:set var=salesList value=${departmentMap.sales} /
   html-el:select name=userForm property=employee
 html-el:options collection=salesList property=label 
labelProperty=value/

   /html-el:select

Here's the entire example page:
http://wiki.wendysmoak.com/cgi-bin/wiki.pl?StrutsOptionsFromMap

--
Wendy Smoak 




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



Struts versions Jboss

2005-05-29 Thread Hond4

Hallo all list members!

is it possible to run 2 versions of struts on one Jboss server?

Thx for help,
H0nd4



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



Re: Newbie Question : Session Management without cookies

2005-05-29 Thread Martin Gainty

Mark-
Have you looked at mod_rewrite?
http://httpd.apache.org/docs-2.0/misc/rewriteguide.html
Viel Gluck,
Martin-

- Original Message - 
From: Mark Breitner [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Sunday, May 29, 2005 1:52 PM
Subject: Re: Newbie Question : Session Management without cookies



Hi - thanks for your answer. I am looking for a way to let strtuts
automatically rewrite the urls. But in the book I am reading right now I
can´t find any hint on how to do this.

Can you tell me how to rewrite the urls, so that user / pwd are send with 
?


Bye,

Mark Breitner



--- Ursprüngliche Nachricht ---
Von: Dave Newton [EMAIL PROTECTED]
An: Struts Users Mailing List user@struts.apache.org
Betreff: Re: Newbie Question : Session Management without cookies
Datum: Fri, 27 May 2005 11:12:59 -0400

Nils Liebelt wrote:

Have a look at J2ee Specs first. So you get an idea of the session
concept.


-Original Message-
From: Mark Breitner [mailto:[EMAIL PROTECTED]
Sent: Friday, May 27, 2005 4:34 PM
Subject: Newbie Question : Session Management without cookies

I just started with struts and wanted to implement an application that 
is
able to do session management (f.e. user + password) even if the user 
has

turned cookies off.

what is the best way to do this ?


Also look at URL rewriting, which Struts supports.

Dave



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



--
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

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




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



Re: Struts versions Jboss

2005-05-29 Thread Michał Steiner

Hond4 napisa(a):

Hallo all list members!

is it possible to run 2 versions of struts on one Jboss server?



Here is similiar problem with solution:

http://www.theserverside.com/discussions/thread.tss?thread_id=31389



--
MiSt

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



Re: Security in Struts

2005-05-29 Thread Adam Hardy

Eddie,
what put you off CMA?

if you don't mind me asking.
Adam

On 28/05/05 19:00nbsp;Eddie Bush wrote:

Tarek,

Java provides a standard mechanism for you to tell if the person 
accessing your application has a certain permission.  This is available 
through request.isUserInRole(String).  Unfortunately, that only works 
for Container-Managed Authentication (CMA).  You can make it work 
without using CMA, but it takes a little (not too much) work.


Firstly, a Filter instance that is mapped to all your actions (and JSPs 
if you access them directly and they need security).  This filter is 
really simple - if the user isn't authenticated, it sends them to the 
login page. If they are authenticated, the filter lets them pass 
through.  There is one additional responsibility that I'll address later.


Your login process authenticates your users and puts a bean out in the 
session to indicate the person is logged in - which is how your Filter 
knows they are logged in.  I would recommend to you that the class for 
this bean implement java.security.Principal, since you can then use 
request.getUserPrincipal() to retrieve your bean (caveat later).  Your 
login process will, additionally, determine the permissions that the 
person logging in has and make those available somehow in the session 
(my user bean actually stores these).


Now, the caveat I spoke of:

To make request.getUserPrincipal() and request.isUserInRole(String) 
work, you're going to have to write an HttpServletRequestWrapper 
implementation. This is very straight-forward and shouldn't take long.  
What you do here is to implement getUserPrincipal() to return the user 
bean after having retrieved it from the session - under the key you 
bound it to in your login process.  Piece of cake!  You'll also overload 
isUserInRole(String) to retrieve the users roles and determine if the 
passed-in parameter is in their list of roles.  Again - piece of cake!


Your Filter's additional responsibility:

Before calling doChain(request, response), you'll want to wrap the 
request with an instance of your request wrapper.  This is the trick 
(aka Magic!) that makes your application able to use standard methods 
available on the request.


It sounds kind of cumbersome - complex, even - but once you start down 
the road, you'll soon see that it isn't much work at all.  You *might* 
spend a day on all of this - two or three if you're totally unfamiliar 
with everything I've spoken about and have to do some research.  This is 
- far and above - the best approach, but there's actually one better, if 
you can use it:


http://securityfilter.sourceforge.net

Essentially, the security filter project does what I just said you 
needed to do, but it doesn't provide database access to all RDBMS yet.  
Depending on how closely you want to simulate CMA and depending on if 
they have an adapter for your RDBMS, you might be better off 
implementing what I spoke of above yourself.  For me, I wanted to see 
what role a person had inside of an action.  It was easier for me to 
grow my own than write an adapter and have to learn how to use 
SecurityFilter.  That may not be the case for you.


Hope that helps!

Eddie Bush



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



Re: Running Tomcat from Eclipse

2005-05-29 Thread Daniel Kho
yup... post your question in the tomcat mailing list.

On 5/20/05, Yan Hu [EMAIL PROTECTED] wrote:
 Are we on a STRUTS mailing list?
 
 --- m Komma [EMAIL PROTECTED] wrote:
  Hi,
  I am using
  Eclipse 3.0.1,
  Sysdeo 3.0.0 (tomcat plugin for eclpse)
  and Tomcat 5.5.7
  I was able to start tomcat from Eclipse until couple of days back.
  but now, when ever I start tomcat from Eclipse I get the followoing
  error message
 
  (I can start Tomcat if I check the box Don't run Tomcat in debug mode
  Of course, that means that I can't do any debugging.)
 
 
  Thread [main] (Suspended (exception NumberFormatException))
Integer.parseInt(String, int) line: not available
Integer.parseInt(String) line: not available
URI.initializeAuthority(String) line: not available
URI.initialize(URI, String) line: not available
URI.init(URI, String) line: not available
URI.init(String) line: not available
XMLEntityManager.expandSystemId(String, String, boolean) line: not 
  available
XMLEntityManager.setupCurrentEntity(String, XMLInputSource, boolean,
  boolean) line: not available
XMLVersionDetector.determineDocVersion(XMLInputSource) line: not 
  available
JAXPConfiguration(XML11Configuration).parse(boolean) line: not 
  available
JAXPConfiguration(XML11Configuration).parse(XMLInputSource) line: not 
  available
SAXParser(XMLParser).parse(XMLInputSource) line: not available
SAXParser(AbstractSAXParser).parse(InputSource) line: not available
Digester.parse(InputSource) line: 1561
Catalina.load() line: 473
Catalina.load(String[]) line: 509
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
  available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not 
  available
Method.invoke(Object, Object...) line: not available
Bootstrap.load(String[]) line: 243
Bootstrap.main(String[]) line: 408
 
 
  Has anybody come across this problem?
 
  Any help is appreciated.
 
 
  Mallik
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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