I'm currently trying to invoke the servlet directly from
the hyperlink. But I keep getting 404 not found when
I click the href. My HREF directive looks like this
<a
href="http://localhost/Javasource/Controller?command=/SearchForMovers.do?arg
ument=0">Click Here!</a>
The controller lives in a \javasource\Controller directory on the server e:
drive.
Should this work?
-F
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Tom
Copeland
Sent: Wednesday, June 07, 2000 8:51 AM
To: [EMAIL PROTECTED]
Subject: Re: Handling hyperlinks in an MVC servlet app (resending second
time)
I think that any hyperlink on a page will, path-wise, refer back to its
source - be it a servlet, CGI script, or static page in a directory. Of
course, that assumes that all pages are being served fm the controller
servlet, which may not be the case. And so back to the original dilemma....
oh well.
Tom
-----Original Message-----
From: Ferghil O'Rourke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 06, 2000 6:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling hyperlinks in an MVC servlet app (resending second
time)
Mmm. Great. But how will the controller servlet be invoked as the target of
these value?
Once the hyperlink is inside a form that has the controller as its action=""
will
the controller be invoked as a result of a click on the hyperlink?
I'll try it out anyway.
Thanks,
Ferghil
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Tom
Copeland
Sent: Tuesday, June 06, 2000 2:35 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling hyperlinks in an MVC servlet app (resending second
time)
Ferghil -
Chris probably has the right idea here - perhaps it's simplest to
just append the parameters to the hyperlink and then parse the Action class
name. You could do it either by putting it on the path (<a
href="/RetrieveVendors.do?argument=value">) or in the parameter list (<a
href="/Handler?Action=RetrieveVendors&arg1=value1&arg2=value2">).
I don't know too much about design patterns, but this design kind of
sounds like a Command. The requester is decoupled from the target via the
class name table lookup. At least I think that's how a Command works.
Pretty cool anyway.
Yours,
Tom
-----Original Message-----
From: Chris Wilson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 06, 2000 2:27 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling hyperlinks in an MVC servlet app (resending second
time)
why can't you just call the action servlet using a regular link with some
get parameters? (<a href="/RetrieveVendors.do?argument=value">). otherwise
you can still use a form but have a link to a javascript submission of the
form (<a href="javascript:myform.submit();">).
cheers,
chris
chris wilson > web developer > andrews university > www.andrews.edu
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Ferghil O'Rourke
> Sent: Sunday, May 07, 2000 11:22 AM
> To: [EMAIL PROTECTED]
> Subject: Handling hyperlinks in an MVC servlet app (resending second
> time)
>
>
> Anyone got any ideas on how handle hyperlinks in an MVC
> controller servlet?
>
> We've been in the process of developing a servlet based on the MVC model 2
> architecture for the last few months now. And many thanks to Craig for his
> key contributions here. I've implemented his action class mechanism
> successfully to have a single "controller" servlet interact with java
> business objects thru action objects.
>
> Each action object maps to the name attached to a FORM SUBMIT in our JSP
> pages. So, for example, a pushbutton submits the name "RetrieveVendors.do"
> to the controller servlet, the servlet uses this string as a key to a
> hashtable of action class names, instantiates the relevant action
> class, and
> finally invokes it's perform() method. The action class then
> takes over and
> performs processing relavant to that pushbutton. It also has the
> facility to
> pull all the data from the SUBMIT into the relevant business object.
>
> It all works very nicely. However, the whole mechanism does depend on all
> interaction with the controller servlet being performed using
> FORM SUBMITS.
> I'm fine with this but there are times when I'll want to interact with the
> controller servlet via a hyperlink - or **via a SUBMIT that looks and
> behaves like a hyperlink.**
>
> SUBMITs will always look like button clicks - the mouse pointer
> doesn't turn
> into a finger but remains as an arrow etc. There are ways to make SUBMITs
> resemble hyperlinks using IE4 style tags but these don't work for
> netscape.
>
> Anyone encountered this sort of problem before? I'd prefer to keep
> everything as a SUBMIT so that I'm always routing through the servlet. I'd
> like to compromise and use a real hyperlink only when the target page
> contains static content.
>
> Any ideas thoughts really welcome.
> Thanks,
> Ferghil O'Rourke
> USMoving.com - chief programmer
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html