struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: [SOLVED] Default methodName for DispatchAction
Date Wed, 02 Jun 2004 15:48:22 GMT
Keith-

you need to supply the HTTP variable HTTP_USER_AGENT
to BrowserType before modelBrowse
String UserAgent =  (String) request.getHeader("User-Agent");

HttpSession currSession = request.getSession(true);

//This sets up the user.agent for the session
currSession.putValue("user.agent",UserAgent);

//This sets the local variable BrowserType to the HTTP Variable
BrowserType = UserAgent;

Does this help???

-Martin


----- Original Message ----- 
From: "Kamholz, Keith (corp-staff) USX" <kkamholz@moog.com>
To: "'Struts Users Mailing List'" <user@struts.apache.org>
Sent: Wednesday, June 02, 2004 10:00 AM
Subject: RE: [SOLVED] Default methodName for DispatchAction


> Hmmmmm....
> It's not working for me.  I have a form with 4 different submit buttons.
> I'm trying to get it to execute the 'unspecified' method of my
> LookupDispatchAction when the user presses 'Enter' rather than clicking on
a
> button.
>
> Right now I have:
>
> public ActionForward unspecified(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse
> response)
> throws Exception
> {
> System.out.println();
> System.out.println("'Unspecified' Method executing...");
> System.out.println();
> return modelBrowse(mapping, form, request, response);
> }
>
> But when I press 'Enter' after filling in the form, my output doesn't get
> written to the console and I get an error that says:
> javax.servlet.ServletException: Request[/Browse] does not contain handler
> parameter named browseType
>
> Does anyone know what I'm doing wrong or how to fix this?  It works fine
> when I click on a button, but not when I press 'Enter'.
> Thanks!
>
>
>
> - Keith
>
>
>
>
> -----Original Message-----
> From: Kunal H. Parikh [mailto:kunalp@carsales.com.au]
> Sent: Tuesday, June 01, 2004 10:11 PM
> To: 'Struts Users Mailing List'
> Subject: RE: [SOLVED] Default methodName for DispatchAction
>
>
> Hi All!
>
> Just went through the source code.
>
> This problem can be attacked by overriding the method unspecified(...)
>
> ===========
> public ActionForward unspecified(
>             ActionMapping mapping,
>             ActionForm form,
>             HttpServletRequest request,
>             HttpServletResponse response)
>             throws Exception {
> ===========
>
> Thanks,
>
> Kunal
> -----Original Message-----
> From: Kunal H. Parikh [mailto:kunalp@carsales.com.au]
> Sent: Wednesday, 2 June 2004 11:53
> To: 'Struts Users Mailing List'
> Subject: Default methodName for DispatchAction
>
> Hi All!
>
> I was wondering if it were possible to have a "default" method called when
> there is no parameter matched or the parameter is null.
>
>
> TIA,
>
> Kunal
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message