• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

jsp link inputs

 
Ranch Hand
Posts: 83
MS IE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a problem here in my jsp code... this page returns all the available buses ....these information is collected from a servlet which forwards the available buses data to this jsp page... now my question is when this page shows up , there exists hyperlinks to each available buses ... on clicking in any one of the links ( which sigfnify my choice of selecting the bus with which i want to travel) , a form will appear where customer will have to specify his info... okay fine... but how are these hyperlinked choices going as inputs ??? can someone explain me with proper code ??? In short my question is how can i make hyperlinked items as inputs ..??? The following is the jsp code .... ( and i know it's not good to add java code in jsp directly ... So apart from that any suggesstion to fullfill my goal please....)

 
author & internet detective
Posts: 41413
854
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<a href="form.jsp">
This takes you to another page but doesn't provide a way of knowing which item you care about.

<a href="form.jsp?item={$item}>
This adds it as a parameter.

<a href="/form?item={$item}>
This is even better because it uses MVC and doesn't have you sending directly from one JSP to another. (The logic/flow in the JSP is worse than the Java in the JSP.)

[edited because software bug wiped out my posts]
 
J Das
Ranch Hand
Posts: 83
MS IE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:<
(The logic/flow in the JSP is worse than the Java in the JSP.)



which flow are you talking about... be specific please.. i need to learn so point out my mistakes..
 
Jeanne Boyarsky
author & internet detective
Posts: 41413
854
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having one JSP forward directly to another. This forces all of your logic to be in the JSP. It should be in a servlet instead so the JSP is just handling presentation.
 
I don't like that guy. The tiny ad agrees with me.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic