Hi,
not sure if this is standard approach:
1. make a hyperlink <a>..</a>
2. give it an onclick="clicked()"
3. define the clicked() function.
4. in the function do a: document.formName.submit()
oh yes, define that form with the method=POST and the
action pointing to your servlet.
ron
--- Ferghil O'Rourke <[EMAIL PROTECTED]> wrote:
> [sorry, not sure this got submitted earlier...]
>
> 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: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets