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
help You: > http://struts.apache.org/2.2.1.1/docs/stream-result.html > > Best greetings, > Paweł Wielgus. > > > 2011/4/24 Jake Vang : >> Dave, >> >> is there anyway to set it up so that the session can be created and >> not destroyed when i return

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
s > Eduard > P.S.: Do not forget to define the corresponding setter method for injection > > Am 01.11.2010 08:37, schrieb Jake Vang: >> >> i have a custom field validator that extends FieldValidatorSupport. >> inside this class, i need to access some beans as defined i

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.

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
uts 2 will use Spring to manage > the Action lifecycle, meaning you can inject anything the way you are > describing it above (including String, etc...) > Denis. > > Le 2010-05-13 08:09, Jake Vang a écrit : >> >> thanks. example please? (when you have time). >&

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
gt; >> I found at some point I could jsut do >> >> public class MyAction extends ActionSupport { >> >> private MyInjectedService service >> >> etc etc >> >> But I have started doing: >> >> public class MyAction extends ActionSupport {

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

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
new dojo tags are at 1.4.  I solved a similiar height problem on dojo > 1.4 by doing the following. > > >   >      body, html { height: 99%;overflow:hidden; > margin-bottom:0;padding-bottom:0;} >   > > > > preload="false" style="width:100%;height:100

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
g list) >    { >        this.list = list; >    } > } > > Of course "list" is one of my custom tag's attributes and appropriately > defined in my TLD. > > Cheers, > Bill > > > On Mon, Feb 1, 2010 at 5:04 AM, Jake Vang wrote: > >> i fo

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-