Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well the first thing is the HTTP post. You submit your form to a special page. You will get the selected item within the request parameter.</p> <p>So you create a <code>&lt;form ... &gt;...&lt;/form&gt;</code> the actions leads to your jsp. Now you'll get the parameter after submitting the form.</p> <p>The action should be <code>action="./CodeSelector.jsp"</code></p> <p>Now some critics regarding your code:</p> <ol> <li>It is to long, I would suggest to split the behaviour into some kind of form.jsp and another store.jsp. You should split your code, to gain a better overview of your code.</li> <li><strong>NEVER</strong>, under <strong>NO CIRCUMSTANCES</strong> take request-parameter and append them to a query. This will lead into severe sequrity risks. Just don't start with this. Always use <a href="http://docs.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html" rel="nofollow">PreparedStatement</a> and set the parmeter. This will lead into secure queries in terms of <a href="http://en.wikipedia.org/wiki/SQL_injection" rel="nofollow">SQL-injections</a>.</li> <li>Think about more modern frameworks for creating Java-Backed Websites. I have used <a href="http://javaserverfaces.java.net/" rel="nofollow">Java Server Faces</a> and <a href="https://developers.google.com/web-toolkit/" rel="nofollow">GWT</a>. You will have more to learn, but incredible less to Code (I think). </li> </ol> <p>A single JSP-page will lead into untestable write once. never understand code. With modern frmework, or JSP and <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gjbnz.html" rel="nofollow">CDI</a> you will split your code into gui (JSP) and logic (Java)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload