RE: Login with Struts2

2009-07-16 Thread Nitesh Jain
Hi, I have also implemented login mechanism but I have used Servlet filter to check the user login status. I have applied filer on the restricted URI of my application by just a small configuration in web.xml. Regards, Nitesh Jain -Original Message- From: Robin Mannering [mailt

Re: in JSP: rounding values

2009-07-16 Thread Lukasz Lenart
2009/7/17 mathias-ewald : > I want to round a value during an interation: Maybe it will be better to prepare a list on server side with rounded values and iterate over them? Regards -- Lukasz http://www.lenart.org.pl/ http://dailylog.lenart.org.pl/ Pablo Picasso - "Computers are useless. They

RE: Freemarker and Select Tag

2009-07-16 Thread Nitesh Jain
Hi Robin, Select tag expects an list object in the list attribute but in your case you are providing an Map that's why it is not behaving correctly. I suggest create an object called UserType with two fields id and name. And put these objects into a list (lets say usertypes). Now use follo

Re: struts 2 adoption/performance/scalability

2009-07-16 Thread Wes Wannemacher
On Thursday 16 July 2009 07:12:25 pm Musachy Barroso wrote: > I am trying to "sell" the idea of using Struts 2 to my employer, and I > know these questions will come up: > > 1. Who is using it? > 2. How does it perform, compared to plain servlets and jsps? > 3. How well does it scale? > 4. Has anyo

Re: EJB Injection in Interceptor

2009-07-16 Thread Nathan Schulte
Wes Wannemacher wantii.com> writes: > Seems to me that my idea to create an ObjectFactory based plugin ... needs to pick up some steam. > I only have one question for the EJB users out there... Do you guys need Spring integration as well? To answer your question, _I_ personally don't need Spring

in JSP: rounding values

2009-07-16 Thread mathias-ewald
Hi, I want to round a value during an interation: -- (Min: , Max: ) <% int val = 0; %> --

Re: [Struts 2] Date conversion general bug!

2009-07-16 Thread Zoran Avtarovski
I agree that date conversion is a real problem for S2, especially in multi lingual applications. We¹ve had to implement our own converter which either looks for a format value with the date string or picks up a list of default prioritised date formats and tries each one successively until success

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Wes Wannemacher
On Thursday 16 July 2009 07:14:30 pm Dave Newton wrote: > > IMO that's outside the purview of unit testing, though--by definition > this describes integration testing: the testing of an action along with > the framework. > > There's nothing *wrong* with doing that testing, I just don't think it's >

Re: EJB Injection in Interceptor

2009-07-16 Thread Wes Wannemacher
On Thursday 16 July 2009 04:20:05 pm Nathan Schulte wrote: > Nils-Helge Garli Hegvik gmail.com> writes: > > The short answer - You have to do the lookup yourself. > > > :/ > : > > The long answer - There's a similar discussion going on that pretty > > much covers the topic: > > http://www.nabble.c

Re: [Struts 2] Date conversion general bug!

2009-07-16 Thread rsilva
Hi, I think this link can help. http://jira.opensymphony.com/browse/XW-670 Aloha, Rafael Sobral Milan Milanovic wrote: > > I'm sorry, but I finally got what is the problem. I'm sending in this > thread and I want people on the list know what I have find. It very bad > that nobody from Strut

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Dave Newton
Ritvars Rundza-ns wrote: Yes, 2nd one contains ParametersInterceptor call, but both of them contains StaticParametersInterceptor call. You mentioned, that "static param interceptor, so you have that set up somewhere". There are no explicitly defined interceptors @ my-super-app. The default stac

Re: Design Practice question. Should I use same Action class for different functions?

2009-07-16 Thread Dave Newton
tsongwei wrote: This is a general design practice question. Say if I am designing User Account Management component that does the following: 1) User Profile info update -- updates firs name, last name, etc,... 2) Change password. -- do password verification, and change password 3) User Payment in

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Dave Newton
Haroon Rafique wrote: We like to test against the complete struts context include the relevant interceptor stack. This gives us the ability to test for all kinds of combinations of compelte and partially incomplete input. IMO that's outside the purview of unit testing, though--by definition t

struts 2 adoption/performance/scalability

2009-07-16 Thread Musachy Barroso
I am trying to "sell" the idea of using Struts 2 to my employer, and I know these questions will come up: 1. Who is using it? 2. How does it perform, compared to plain servlets and jsps? 3. How well does it scale? 4. Has anyone benchmark it under load? numbers? 2-4 are somewhat related. I am sure

Re: Plug-in creation and freemarker page location

2009-07-16 Thread Musachy Barroso
Well, actually I am wrong about that and yes, if there is no "/", it will use the namespace name: if (!locationArg.startsWith("/")) { ActionContext ctx = invocation.getInvocationContext(); HttpServletRequest req = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQ

Re: Plug-in creation and freemarker page location

2009-07-16 Thread Musachy Barroso
there is no magic there, remove the first "/" and give it a try. musachy On Thu, Jul 16, 2009 at 12:29 PM, stanlick wrote: > > I am working on a plug-in and having trouble getting the runtime to find my > freemarker pages.  I have a folder named pages in my plugin.jar where my > freemarker pages

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Ritvars Rundzāns
Yes, 2nd one contains ParametersInterceptor call, but both of them contains StaticParametersInterceptor call. You mentioned, that "static param interceptor, so you have that set up somewhere". There are no explicitly defined interceptors @ my-super-app. Ok, whatewer, this is irrelevant. Just deplo

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread Lukasz Lenart
2009/7/16 jayadevan : > xwork-2.0.4.jar, > ognl-2.6.11.jar, > jsp-api-2.0.jar,freemarker-2.3.8.jar, > commons-logging-1.0.4.jar > these are other jars And struts2-core.jar, which version? Do you have some other exception when you're starting Tomcat? Regards -- Lukasz http://www.lenart.org.pl/ h

struts1 and jasper reports

2009-07-16 Thread Odelya YomTov
Hi! I would like to implement JASPER and my struts1 appliction I have list of orders and items and I would like to use it . I am new to JASPER. Does anyone know of an example for it? Thanks - To unsubscribe, e-mail: user-unsub

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Musachy Barroso
uh? This is from the 2nd stack: ParametersInterceptor.doIntercept(ActionInvocation) line: 187 ParametersInterceptor(MethodFilterInterceptor).intercept(ActionInvocation) musachy On Thu, Jul 16, 2009 at 1:33 PM, Ritvars Rundzāns wrote: > Look carefully! As you can see, BOTH setters origin from sta

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Ritvars Rundzāns
Look carefully! As you can see, BOTH setters origin from static params interceptor (1st: line 129, 2nd - line 148). And i do not have set it up somewhere - look @ war. Config is as simple as possible.

Re: EJB Injection in Interceptor

2009-07-16 Thread Nathan Schulte
Nils-Helge Garli Hegvik gmail.com> writes: > The short answer - You have to do the lookup yourself. :/ > The long answer - There's a similar discussion going on that pretty > much covers the topic: > http://www.nabble.com/Struts2-Action-Class-and-EJB-Injection-td24497801.html Yes, I'm familiar wi

Re: EJB Injection in Interceptor

2009-07-16 Thread Nils-Helge Garli Hegvik
The short answer - You have to do the lookup yourself. The long answer - There's a similar discussion going on that pretty much covers the topic: http://www.nabble.com/Struts2-Action-Class-and-EJB-Injection-td24497801.html Nils-H On Thu, Jul 16, 2009 at 10:03 PM, Nathan Schulte wrote: > This may

EJB Injection in Interceptor

2009-07-16 Thread Nathan Schulte
This may be more related to XWork2, but I'll start by asking here. I'm creating a custom Interceptor to handle user permissions for an application. Rather than redirecting to an action to actually process a login attempt (requiring a custom result type), the Interceptor itself will process the lo

Design Practice question. Should I use same Action class for different functions?

2009-07-16 Thread tsongwei
Hi, This is a general design practice question. Say if I am designing User Account Management component that does the following: 1) User Profile info update -- updates firs name, last name, etc,... 2) Change password. -- do password verification, and change password 3) User Payment info update. -

Re: Login with Struts2

2009-07-16 Thread Robin Mannering
Hi, I recently implemented a login mechanism but did it slightly differently after recommendations from this mailing list to use an interceptor. Each action/page that requires a validated login is directed via a Interceptor. The sole purpose of the interceptor is to verify the existence of

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Nils-Helge Garli Hegvik
If it's integration testing you want to do, I've had success embedding Jetty and doing "full" in-container integration testing. Embedding Jetty is really easy, and it's pretty fast too. Although not Struts 2 specific, take a look at this article: http://today.java.net/pub/a/today/2007/04/12/embedde

Plug-in creation and freemarker page location

2009-07-16 Thread stanlick
I am working on a plug-in and having trouble getting the runtime to find my freemarker pages. I have a folder named pages in my plugin.jar where my freemarker pages reside. My struts-plugin.xml is referring to the pages as follows: /pages/config.ftl However, I am receiving a runtime java.io.F

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Haroon Rafique
On Today at 1:19pm, GL=>Greg Lindholm wrote: GL> Well everyone has an opinion so here mine: GL> GL> I want to unit test my Struts actions in the full Struts context which GL> includes the interceptor stack and validation. This way I know my GL> actions and results are configured correctly sinc

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Musachy Barroso
#1 is from the static param interceptor, so you have that set up somewhere, and the second one is from the normal request parameter (params interceptor) On Thu, Jul 16, 2009 at 10:35 AM, Ritvars Rundzāns wrote: > I put BP @ setCmd. > > 1st hit: > ---

RE: Login with Struts2

2009-07-16 Thread Kawczynski, David
Take a look at Spring Security (formerly ACEGI). http://static.springsource.org/spring-security/site/ > -Original Message- > From: mathias-ewald [mailto:nitehoax...@gmx.net] > Sent: Thursday, July 16, 2009 2:37 PM > To: user@struts.apache.org > Subject: Login with Struts2 > > > Hi, >

Login with Struts2

2009-07-16 Thread mathias-ewald
Hi, I am trying to implement a login mechanism. I will now explain what I did and what error I get but in case there is a more sophisticated way to do that - please tell me! I created a BaseAction which is the parent of all my Actions. The BaseAction is supposed to be responsible for displaying

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Dimitrios Christodoulakis
Thanks everyone for their opinions. I was indeed hoping to hear both sides of this matter, with both bringing valid arguments and make good points. I was wondering with popular frameworks like struts, spring and hibernate integrated together and the increasing adoption of test driven, and agile de

Date validation in struts 2

2009-07-16 Thread Siddiq Syed
Hi all, I am trying to validate the date field through the xml by using the date validator defined.   The problem with this is we can't have leap year validation with this, nor formate validation and need to specify the date range. Is there any way where I can validate the date(which impl

Date Validation in Struts 2

2009-07-16 Thread Siddiq Syed
Hi all, I am trying to validate the date field through the xml by using the date validator defined. The problem with this is we can't have leap year validation with this, nor formate validation and need to specify the date range. Is there any way where I can validate the date(which implici

Re: URL to underlying action

2009-07-16 Thread mathias-ewald
Works - thx. I should have seen that in the doc though ^^ Nils-Helge Garli wrote: > > Try using the url tag without specifying value or action. > > Nils-H > > Den 16. juli. 2009 kl. 13.14 skrev mathias-ewald : > >> >> Hi, >> >> is there a way to create a URL (like ) to the Action that >> c

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Ritvars Rundzāns
I put BP @ setCmd. 1st hit: > Daemon Thread [http-8080-2] (Suspended (breakpoint at line 28 in Person)) Person.setCmd(String) line: 28 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) lin

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Greg Lindholm
Well everyone has an opinion so here mine: I want to unit test my Struts actions in the full Struts context which includes the interceptor stack and validation. This way I know my actions and results are configured correctly since I test them. I also know my declarative validations are working co

disabling html:select and html:text by the value in another html:select

2009-07-16 Thread Odelya YomTov
Hi! i have these components: i would like that when the user chooses a specific value in data.payingType - it would disable/enable the other html:select and html:text. i wrote this function:

session on every request?

2009-07-16 Thread Mitch Claborn
It appears that every request through struts is getting a copy of the Session object, even for those that don't need it, like static resources (.js, .css, etc). Can I disable this behavior somehow, only getting the session when I need it? Below is a sample stack trace. at org.apache.cata

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Musachy Barroso
+1 for what Wes said. Plus, I would say, the junits become so complex (when you do integration test from them), that from my experience, when they break, people don't want to fix them (because we have to admit, we are lazy). musachy On Thu, Jul 16, 2009 at 8:28 AM, Wes Wannemacher wrote: > I have

Re: Setter in action triggers twice. Bug?

2009-07-16 Thread Musachy Barroso
can you put a breakpoint in the setter and see where is it called from? (both times) musachy On Thu, Jul 16, 2009 at 8:08 AM, Ritvars Rundzāns wrote: > Hi! > > I am wondering, why setters for cmd and id fields @ my Person action (see > below) is called twice. For example, when browser requests >

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Wes Wannemacher
I have a few thoughts on this, but I am somewhat opinionated when it comes to unit testing. Personally, I don't think it's necessary to test your actions with the interceptors. If you want to make sure that your actions fit into the struts flow of things, then unit testing is probably not the right

Setter in action triggers twice. Bug?

2009-07-16 Thread Ritvars Rundzāns
Hi! I am wondering, why setters for cmd and id fields @ my Person action (see below) is called twice. For example, when browser requests /person-aaa-bbb?dum=ccc , this gets stdout-ed : example.per...@113981b 18061339 setCmd ]aaa[ setId ]bbb[ setCmd ]aaa[ setDum ]ccc[ setId ]bbb[ execute I know s

Freemarker and Select Tag

2009-07-16 Thread Robin Mannering
Hello, Platform : Struts 2, EJB 3.0, Glassfish 2.1 I'm having trouble using the Freemarker equivalent of the JSP Struts 2 Select Tag. I need to convert: into the Freemarker equivalent. userTypes is an application defined attribute. I have checked the existence of the attribute within th

unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Dimitrios Christodoulakis
Hello, I was hoping to hear the community's views about unit testing a Struts2 application which is integrated with Spring and Hibernate. My plan is to unit test the actions with the framework's interceptors running, rather than each action class in a stand-alone isolated fashion. What approach d

integer values in struts forms

2009-07-16 Thread Sandy.Verfaille
Hi, I have made a struts form: Name nl price: and the mapped actionclassmethod addProduct with: public String addProduct(){ Product p = new Product(productNameNl, productPrice); ProductDA.getInstance().addProduct(p); return SUCCESS; } public void setProductNameNl(String productNameNl) { thi

RE: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread Martin Gainty
struts needs to map url requests to FilterDispatcher your WEB-INF/web.xml should have filter configured and mapped as: struts org.apache.struts2.dispatcher.FilterDispatcher actionPackages your.action.package templ

RE: how to configure struts2 for /*.action?

2009-07-16 Thread Struts Two
Let's say you have /*.action as your filter URL and you have Websphere application server and IBM Http server as your webserver. Once you try to generate your plugin file for http server, *.action is not picked up by WAS as filter are ignored [since they are not supposed be accessed directly fo

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread jayadevan
hi xwork-2.0.4.jar, ognl-2.6.11.jar, jsp-api-2.0.jar,freemarker-2.3.8.jar, commons-logging-1.0.4.jar these are other jars Lukasz Lenart wrote: > > 2009/7/16 jayadevan : >> u said struts-tags.xml is  already in struts2-*.jar >> so add struts2-core.jar into class path and try to exccute >> >> the

Re: URL to underlying action

2009-07-16 Thread Nils-Helge Garli Hegvik
Try using the url tag without specifying value or action. Nils-H Den 16. juli. 2009 kl. 13.14 skrev mathias-ewald : Hi, is there a way to create a URL (like ) to the Action that called a JSP file? I would like to reuse some code like forms and other stuff cu mathias -- View this message

RE: Struts2 Action Class and EJB Injection

2009-07-16 Thread Martin Gainty
ive used OpenEJB with TC then again you could deploy your EAR to a true EJB3 container with a J2EE-AppServer such as GF, WL or AMSServer..even resin would handle EJBs ? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confide

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread Lukasz Lenart
2009/7/16 jayadevan : > u said struts-tags.xml is  already in struts2-*.jar > so add struts2-core.jar into class path and try to exccute > > then i got the following exception > > org.apache.jasper.JasperException: File "/struts-tags.tld" not found struts-tags.tld is for sure in struts2-core.jar,

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread jayadevan
hi u said struts-tags.xml is already in struts2-*.jar so add struts2-core.jar into class path and try to exccute then i got the following exception org.apache.jasper.JasperException: File "/struts-tags.tld" not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultEr

URL to underlying action

2009-07-16 Thread mathias-ewald
Hi, is there a way to create a URL (like ) to the Action that called a JSP file? I would like to reuse some code like forms and other stuff cu mathias -- View this message in context: http://www.nabble.com/URL-to-underlying-action-tp24514500p24514500.html Sent from the Struts - User mailing li

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread Lukasz Lenart
2009/7/16 jayadevan : > i tried both way > directly > and step by step You should avoid directly accessing jsp files, always go through actions. Especially when you are using Struts tags inside. Regards -- Lukasz http://www.lenart.org.pl/ http://dailylog.lenart.org.pl/ Ogden Nash - "The troub

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread Lukasz Lenart
2009/7/16 jayadevan : > my index.jsp like this Is it the same file as in web.xml for welcome-file? > where i place "struts-tags.xml " ? It's already in struts2-*.jar Regards -- Lukasz http://www.lenart.org.pl/ http://dailylog.lenart.org.pl/ Joan Crawford - "I, Joan Crawford, I believe in th

Re: ParameterInterceptor problem

2009-07-16 Thread Say Jon
Thanks Robert for your inputs. Well I'm sure that Struts does initialize all null objects along the object chain if they are null, because for 90% of the time, this works. I do not explicitly initialize objects along the object chain in my code. For most of the time, Struts detects that it is null

Re: ParameterInterceptor problem

2009-07-16 Thread Robert Graf-Waczenski
Say Jon schrieb: public void prepare() throws Exception { super.prepare(); BaseEntity model = null; if (getId() != null) { model = (BaseEntity) session.get(getEmbeddedModelKey() + getId()); if (model == null) model = service.retrieve(modelClass, getId()); } if (model == null && !(this inst

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread jayadevan
my index.jsp like this <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> http://www.w3.org/TR/html4/loose.dtd";> <%...@taglib uri="/struts-tags" prefix="s" %> Hello World

Re: org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-16 Thread jayadevan
i tried both way directly and step by step Lukasz Lenart wrote: > > It's ok, when you got that exception? What url were you entering in > web browser? It looks like you went directly to jsp. > > > Regards > -- > Lukasz > http://www.lenart.org.pl/ > http://dailylog.lenart.org.pl/ > > Timothy

Re: ParameterInterceptor problem

2009-07-16 Thread Say Jon
Hi Robert, Thanks for the reply. I'm heartened that Struts 2 have a live community that can help with issues. Firstly, yes you are right that I'm using a ModelDriven. I have a super class ModelDrivenAction which my other action classes extend from. public void prepare() throws Exception { super.