Re: unit testing with junit + spring + struts2, NullPointerException with HttpServletRequest

2011-05-13 Thread Jake Vang
ServletResponse(response); String result = action.dummyAction(); Assert.assertNull(result); //should always be null String json = response.getContentAsString(); Assert.assertNotNull(json); //shouldn't be null On Fri, May 13, 2011 at 2:58 PM, Jake Vang wrote: > hi, > > i am using

unit testing with junit + spring + struts2, NullPointerException with HttpServletRequest

2011-05-13 Thread Jake Vang
hi, i am using struts v2.1.8.1 + spring 3.0 + junit 4.0. it should be noted that i am using convention plugin for spring. my action class extends ActionSupport and implements ServletRequestAware and ServletResponseAware. the method i am testing inside my action class never returns a string litera

Re: streaming plain text, json, xml back to the user, IllegalStateException

2011-04-27 Thread Jake Vang
Pawel, you know of anything like this but for the convention plugin? I don't use XML anymore. In fact, I've gotten away a lot with almost a purely annotation based approach. In fact, my struts.xml is 4-5 lines only. 2011/4/26 Paweł Wielgus : > Hi Jake, > maybe this aproach would

Re: streaming plain text, json, xml back to the user, IllegalStateException

2011-04-24 Thread Jake Vang
, Dave Newton wrote: > My first guess would be to return null so you're not rendering a jsp after > the output stream is closed. > > Dave >  On Apr 22, 2011 11:49 PM, "Jake Vang" wrote: >> what i did to get rid of this message was to add the following line >&

Re: streaming plain text, json, xml back to the user, IllegalStateException

2011-04-22 Thread Jake Vang
ess.jsp. Thank you so much. On Sat, Apr 23, 2011 at 12:11 AM, Dave Newton wrote: > My first guess would be to return null so you're not rendering a jsp after > the output stream is closed. > > Dave >  On Apr 22, 2011 11:49 PM, "Jake Vang" wrote: >> what i did

Re: streaming plain text, json, xml back to the user, IllegalStateException

2011-04-22 Thread Jake Vang
e. if anyone has a better suggestion, please let me know. On Fri, Apr 22, 2011 at 11:22 PM, Jake Vang wrote: > i am using struts 2 with the convention plugin. i have a bunch of > actions that streams back plain text, json or xml. however, when a > user goes to a certain URL, i

streaming plain text, json, xml back to the user, IllegalStateException

2011-04-22 Thread Jake Vang
i am using struts 2 with the convention plugin. i have a bunch of actions that streams back plain text, json or xml. however, when a user goes to a certain URL, i keep seeing an IllegalStateException : Cannot create a session after the response has been committed. why is this happening? my action

Re: how to access spring beans from inside a custom validator

2010-11-01 Thread Jake Vang
org.springframework.web.context.ContextLoaderListener defined in web.xml. Thanks, On Mon, Nov 1, 2010 at 4:17 AM, Eduard Neuwirt wrote: > Hello Jake, > > It is simple. > Use struts/spring plug in. > Declare your bean within your validator and let spring inject your > validator. > > That's all > > Regard

how to access spring beans from inside a custom validator

2010-11-01 Thread Jake Vang
i have a custom field validator that extends FieldValidatorSupport. inside this class, i need to access some beans as defined in applicationContext.xml by Spring. how do i access the spring managed beans? any help is appreciated.

Re: Struts2 validation

2010-07-13 Thread jake
You can use the fieldexpression validator. See http://struts.apache.org/2.1.8.1/docs/fieldexpression-validator.html for details. On Tue, Jul 13, 2010 at 05:39:52AM -0700, kisja wrote: > > I have two textfield and I would like to validate that at least one of both > have data. > How I can do?

validating integer, java.lang.NoSuchMethodException

2010-07-12 Thread Jake Vang
hi, i am trying to validate an integer field (int primitive type) on a POJO (i.e. MyPojo.integer). i have the validation defined in --validation.xml as follows. ... Integer is required! ... when the form posts to the action, if the value of is left blank, i keep seeing a java.lang.NoSuc

Re: validating integer, java.lang.NoSuchMethodException

2010-07-12 Thread Jake Vang
bean. oh well, you win some, you lose some. if anyone has a better idea, please let me know. thanks. On Mon, Jul 12, 2010 at 11:26 AM, Jake Vang wrote: > hi, > > i am trying to validate an integer field (int primitive type) on a > POJO (i.e. MyPojo.integer). i have the validatio

Re: validation and form display problem

2010-07-11 Thread Jake Vang
your backing beans inside the Prepare method in your > action. That when 'input' is needed, your backing beans will be > loaded. > > On 7/10/10, Jake Vang wrote: >> i have a form that i display. but to display that form, i have to >> fetch some data from the data

validation and form display problem

2010-07-10 Thread Jake Vang
i have a form that i display. but to display that form, i have to fetch some data from the database and then place that data on the valuestack (via backing beans). when the form is displayed, it expects that those backing beans should be populated. the form then posts to a save action. i have a --

Re: convention plugin requires setting @Result explicitly

2010-06-29 Thread Jake Vang
h annotations and the convention plugin. On Tue, Jun 29, 2010 at 7:28 AM, Jake Vang wrote: > i have an Action class in the package > com.company.web.struts.actions.admin.LoginAction. inside LoginAction, > i use Annotation to specify the Action (i.e. @Action(value="/

convention plugin requires setting @Result explicitly

2010-06-29 Thread Jake Vang
i have an Action class in the package com.company.web.struts.actions.admin.LoginAction. inside LoginAction, i use Annotation to specify the Action (i.e. @Action(value="/login") on a method. according to the documentation at, http://struts.apache.org/2.1.8.1/docs/convention-plugin.html, this should

Re: fieldexpression validator not working

2010-06-28 Thread Jake Vang
never mind, i removed # from the OGNL expression and i get the correct behavior now. On Tue, Jun 29, 2010 at 12:23 AM, Jake Vang wrote: > i have a User class with two fields, password and confirmPassword. on > a web form, upon post, i am trying to see if they match using the > fielde

fieldexpression validator not working

2010-06-28 Thread Jake Vang
i have a User class with two fields, password and confirmPassword. on a web form, upon post, i am trying to see if they match using the fieldexpression validator. however, no matter what i try, i keep getting the message that they don't match. in the Tomcat console, i can see this message: Got resu

Re: one-to-many persistence, ConstraintViolationException

2010-06-22 Thread Jake Vang
ken, thanks for responding. i got things to work, but i haven't figured out really why it's working (on a conceptual, philosophical level). here's what i did to the code above. 1. for the Company class, i removed the @ForeignKey annotation 2. for the Employee class, i removed the companyId field.

one-to-many persistence, ConstraintViolationException

2010-06-21 Thread Jake Vang
i am following the example at http://struts.apache.org/2.1.8.1/docs/struts-2-spring-2-jpa-ajax.html. in this example, a very simple persistence is given (of which i am thankful). but, what i am trying to do is slightly more complicated with persistence. i need to persist a one-to-many relationship.

Re: unit test the service layer (aka data access layer)

2010-06-21 Thread Jake Vang
where it talks about extending > AbstractTransactionalJUnit4SpringContextTests for your unit test and the like > > Cheers > > James > > > -Original Message- > From: Jake Vang [mailto:vangj...@googlemail.com] > Sent: 21 June 2010 17:27 > To: Struts Users Mailing List > Subject:

Re: unit test the service layer (aka data access layer)

2010-06-21 Thread Jake Vang
.xml") > public class MyServiceImplTest extends AbstractJUnit4SpringContextTests > { > >   �...@autowired(required = true) >    private MyService myService = null; > > testConfigXML.xml will contain your *test* config.. > > Then do the do! > > > -Original

Re: i need more documentation on applicationContext.xml

2010-06-21 Thread Jake Vang
e les email > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > aucune responsabilité pour le contenu fourni. > > > > >> To: user@struts.apache.org; vangj...@googlemail.com >> Subject: Re: i need more documentation on applicationContext.xml

Re: i need more documentation on applicationContext.xml

2010-06-21 Thread Jake Vang
get things working, but doesn't really explain in detail "why" we are doing what we are doing. that's kind of what i meant. On Mon, Jun 21, 2010 at 10:04 AM, Stephen Turner wrote: > > On Mon, 21 Jun 2010 00:56:19 -0400, Jake Vang > wrote: > >> hi,

i need more documentation on applicationContext.xml

2010-06-20 Thread Jake Vang
hi, i've been reading and studying http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. i want to know what is actually going on in applicationContext.xml. for example, what do these two lines do? please explain or refer me to better documentation. -

unit test the service layer (aka data access layer)

2010-06-20 Thread Jake Vang
hi, i've been following this code here at http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. what i want to know is how to unit test the service layer (or data access object layer). in the case of the link, it would be the PersonServiceImpl class. ---

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
ected into the Action class. The third and fourth lines confirm that the String and boolean values are injected into the service class. thanks. On Thu, May 13, 2010 at 9:32 AM, RogerV wrote: > > > > Jake Vang wrote: >> >>> If you want Spring to create your action cla

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
i would be most pleased. thanks. On Thu, May 13, 2010 at 8:24 AM, Denis Cabasson wrote: > Jake, the short answer to your problem is : use the struts-spring plugin ( > http://struts.apache.org/2.1.8.1/docs/spring-plugin.html ). Include the jar > for that plugin in your classpath, and Str

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
think off the top > of my head. > > -Original Message- > From: Jake Vang [mailto:vangj...@googlemail.com] > Sent: 13 May 2010 11:44 > To: Struts Users Mailing List > Subject: Re: spring, struts2, convention plugin, how to "wire" an action class > > yes. pr

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
> If you want Spring to create your action class (as opposed to Struts > creating them) then you need to define your action in the > applicationContext.xml file. how do you do that? here's a couple of ways i have tried that do NOT work. 1. (normal, naive way that works for defining services)

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cook wrote: > Oh, did you want your action as a spring managed bean? Ah I think i massively > miss read you. You want to inject predefined values etc? > > > -Original Message----- > From: Jake Vang [mailto:vangj

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook wrote: > Yeah sorry, short on time here, didn't see your question at the bottom. Add > the spring jar from the spring project. > > -Original Message- > From: Jake Vang [mailto:vangj...@googlemail.com]

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook wrote: > Nope, no they are not in the xml for me. I use the @Service/@Repository > annotations on the class, coupled with the component scan in the Spring xml. > > -Original Message-

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
t; > I am not sure if that alters the way Struts2/Spring does it. But it does > make it a bit clearer to read. > > -Original Message- > From: Jake Vang [mailto:vangj...@googlemail.com] > Sent: 13 May 2010 10:23 > To: user@struts.apache.org > Subject: spring, struts2,

Re: spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
vate MyInjectedService service > > etc etc > > But I have started doing: > > public class MyAction extends ActionSupport { > > @Autowired > private MyInjectedService service > > I am not sure if that alters the way Struts2/Spring does it. But it does > make

spring, struts2, convention plugin, how to "wire" an action class

2010-05-13 Thread Jake Vang
i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring fo

Struts release >2.1.9

2010-05-10 Thread jake
Hi, When will there be a GA release of 2.1.9 or above? Cheers, Jake - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: how to customize the rendering of a tabbedpanel? struts2, dojo plugin

2010-02-05 Thread Jake Vang
M, Stephen Ince wrote: > Jake, >  I actually ran into a lot problems accessing dojo from other > servers. They all went away when I installed it locally. I think you > get some sandbox security issues with some of the packages. > > cheers, > Steve > > On Fri, Feb

Re: how to customize the rendering of a tabbedpanel? struts2, dojo plugin

2010-02-05 Thread Jake Vang
use i didn't want to do programming (Java or JavaScript) right on the page. On Thu, Feb 4, 2010 at 6:10 PM, Stephen Ince wrote: > Jake, >  The sx: tags are based on the .4 dojo tags. I would just use the > dojo tags themselves. The dojo plugin is also being depricated. The >

how to customize the rendering of a tabbedpanel? struts2, dojo plugin

2010-02-04 Thread Jake Vang
i'm using the in the struts2-dojo-plugin. i have a few questions on controlling the display/rendering of this component. 1. can i make the expand 100% in height? i've tried several things: a) place the inside a and set the height of the table to 100%, b) set the height to 100%, c) set the he

Re: struts 2, writing a custom tag that is able to access objects in ActionContext using OGNL

2010-02-01 Thread Jake Vang
bill, thanks for including the code (especially the import statements so i will know where these objects/classes are coming from). On Mon, Feb 1, 2010 at 11:09 AM, Bill Bohnenberger wrote: > Hi Jake, > > I have a custom table tag that needs Value Stack access, too. > Here&#

Re: struts 2, writing a custom tag that is able to access objects in ActionContext using OGNL

2010-02-01 Thread Jake Vang
i found something helpful here. it works. http://struts.apache.org/2.1.8.1/docs/access-to-valuestack-from-jsps.html On Mon, Feb 1, 2010 at 7:34 AM, Jake Vang wrote: > i was wondering if it was possible to write a custom tag that is able > to access objects in the ActionContext using OGN

Re: interceptor is not being called for all action

2010-02-01 Thread Jake Vang
rkpackages >> > several times and do not see the connection.  I'm not sure I understand > exactly what you > did solved the problem, but it is clerarer than the documention > > > --- On Sat, 1/30/10, Jake Vang wrote: > > > From: Jake Vang > Subject: Re: inter

struts 2, writing a custom tag that is able to access objects in ActionContext using OGNL

2010-02-01 Thread Jake Vang
i was wondering if it was possible to write a custom tag that is able to access objects in the ActionContext using OGNL? i'm not sure if this is a "correct" question. my problem is that i have a form. the form is posted to an action. the action has getters/setters for the form fields. i then forwa

Re: struts 2 and servlets, how to exclude servlet url patterns from struts filter

2010-02-01 Thread Jake Vang
lets > > > On Sun, Jan 31, 2010 at 9:12 AM, Jake Vang wrote: >> i am using servlets (HttpServlet) and struts 2. my mapping in web.xml >> for the struts filter maps to the url pattern, /*. my servlet maps to >> something like this, /test. however, when i try to access my se

struts 2 and servlets, how to exclude servlet url patterns from struts filter

2010-01-31 Thread Jake Vang
i am using servlets (HttpServlet) and struts 2. my mapping in web.xml for the struts filter maps to the url pattern, /*. my servlet maps to something like this, /test. however, when i try to access my servlet, http://localhost:8080/myapp/test, i get the following message: "There is no Action mappe

Re: interceptor is not being called for all action

2010-01-30 Thread Jake Vang
and methods. wow, it was that easy. On Sat, Jan 30, 2010 at 6:14 PM, Jake Vang wrote: > okay, after fiddling around for 2 hours, with the weak documentation out > there, i think i have it figured out. at least empirically, it works now. > just in case there are other users out ther

Re: interceptor is not being called for all action

2010-01-30 Thread Jake Vang
and methods i want to use the stack? i don't know why this is such a pain (but then again, i'm not a developer on the struts2 project, so there may be a lot of complexities to get this working elegantly that i'm unaware of). On Sat, Jan 30, 2010 at 4:10 PM, Jake Vang wrote: &g

Re: interceptor is not being called for all action

2010-01-30 Thread Jake Vang
or is not called). On Sat, Jan 30, 2010 at 4:37 PM, Dave Newton wrote: > > http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages > > > - Original Message > > From: Jake Vang > > To: user@struts.apache.org > > Sent: Sat, Ja

Re: interceptor is not being called for all action

2010-01-30 Thread Jake Vang
what does that have to do with my problem? please enlighten. On Sat, Jan 30, 2010 at 4:37 PM, Dave Newton wrote: > > http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages > > > - Original Message > > From: Jake Vang > >

interceptor is not being called for all action

2010-01-30 Thread Jake Vang
i have written an interceptor implementation, however, it seems i cannot get it to work. i have followed the instructions at http://struts.apache.org/2.x/docs/interceptors.html. i have also followed the instructions at http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-

Re: Redirect Action and wildcard methods

2009-10-18 Thread jake
Thanks for the reply, it does work as it should, but I made a silly mistake :( Nothing like wasting a day! Jake On Sat, Oct 17, 2009 at 04:23:05PM -0700, Tommy Pham wrote: > > > > > From: "j...@researchtogether.com" > To: user@s

Redirect Action and wildcard methods

2009-10-17 Thread jake
ect - is the .! part of the problem here? and also displayCategory does the same as the more complete action detailed above. Can anyone provide any insight as to why it isn't working as I expect? Cheers, Jake aka _LisWork ---

RE: Struts 2 and SSL

2007-12-19 Thread Jake Robb
Have a look at the implementation of the plugin's interceptor: http://struts2-ssl-plugin.googlecode.com/svn/trunk/plugin/src/main/java/ com/googlecode/sslplugin/interceptors/SSLInterceptor.java Just change it so that it looks at something else instead of the annotation. -Jake -Ori

RE: preselect

2007-12-12 Thread Jake Robb
What about using s:checkboxlist with a single-item list? -Jake -Original Message- From: bhaarat Sharma [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 4:36 PM To: Struts Users Mailing List Subject: Re: preselect tried it and doesnt work :( this is a real drawback that

RE: [S2] Restricting paths?

2007-11-06 Thread Jake Robb
space setting of your package? - Gary Jake Robb wrote: > I have an action called MainMenu. It's defined as follows: > > > mainMenu > > > (I'm using the Spring plugin - mainMenuAction is the name of the spring > bean) >

[S2] Restricting paths?

2007-11-06 Thread Jake Robb
definition like so: mainMenu But now my action isn't available at *any* path. How can I restrict access to the action to only the path(s) I want? Thanks! -Jake - To unsubscribe, e-mail: [

[S2] Display Tag? (2.0.11)

2007-11-01 Thread Jake Robb
the stack. So I added a push tag: Then I discovered that s:push doesn't accept runtime expressions, just like everything else in 2.0.11. So, how do I accomplish this? I guess I could keep it the old way, but I'd

RE: property from S2 in S1

2007-10-12 Thread Jake Robb
I think you're looking for bean:write. -Jake -Original Message- From: Pavel Sapozhnikov [mailto:[EMAIL PROTECTED] Sent: Friday, October 12, 2007 1:25 PM To: Struts Users Mailing List Subject: s:property from S2 in S1 Hi I have a question. So in S2 you have s:property which just

[S2] Indexed properties

2007-10-10 Thread Jake Robb
a form; I just can't submit back to the action and have it fill in my object. Am I the only one that thinks that the current S2 way is a huge pain? -Jake Robb - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: [S2] s:if test attribute not a runtime expression?

2007-10-10 Thread Jake Robb
ze() > 0} (I didn't test it, I'm just guessing) -W On 10/10/07, Jake Robb <[EMAIL PROTECTED]> wrote: > Pardon me for being totally new to OGNL, but what would be the > equivalent of ${not empty rules}? > > -Original Message- > From: Wes Wannemacher [

RE: [S2] s:if test attribute not a runtime expression?

2007-10-10 Thread Jake Robb
On 10/10/07, Jake Robb <[EMAIL PROTECTED]> wrote: > Okay, this might be a question for the dev list, but bear with me for a > minute. > > My application is currently using Struts 2.0.8. I read about some > security and bug fixes in 2.0.9 and 2.0.10. According to the Struts >

[S2] s:if test attribute not a runtime expression?

2007-10-10 Thread Jake Robb
on: Is that a deliberate change? If so, why, and what is the new way to accomplish what I was doing before? And a side question: once a version is "complete" in JIRA, what else has to happen before that version becomes GA? Thanks, Jake Robb -

List properties in Struts 2

2007-10-09 Thread Jake Robb
proaches (indexed and mapped setters, and changing the name properties on the textfield tags accordingly), but I did some googling and found this: http://www.mail-archive.com/user@struts.apache.org/msg60905.html. It seems to me that the approach I described above is the same as the one described in that message. I'm thinking this is a typical greenie mistake, and I'm hoping someone here can set me straight. Thanks, Jake Robb