aspose file tools*
The moose likes Servlets and the fly likes parameters in a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "parameters in a servlet" Watch "parameters in a servlet" New topic
Author

parameters in a servlet

Jasu Yadav
Greenhorn

Joined: Aug 14, 2011
Posts: 8
I want to receive 43 different strings into a servlet using request.getParameter(" "); and want to store them in database.
It is troubling.
(1) Is this due to the sentence I put into the input type ? (43 inputs)
(2) Is there any limits of parameters in a single servlet ? (43 getParameters)
(3) I should something else instead of input type=textbox name=xyz &&&&&&&& String abc=request.getParameter("xyz");

sailaja koney
Greenhorn

Joined: Dec 18, 2011
Posts: 13

what is the error/problem...


sailaja
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 538

You need to tell more details. Just writing, its troubling, will not help.
See this TellTheDetails...
Jasu Yadav
Greenhorn

Joined: Aug 14, 2011
Posts: 8

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.HttpSession;
@WebServlet(name = "SOC_Format", urlPatterns = {"/SOC_Format"})
public class SOC_Format extends HttpServlet {

Connection con; Statement stmt; PreparedStatement pstmt; ResultSet rs;
String str,unit1,fac1, item1,doq1;
String qty1,rate1,amount1;
String one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty;
String toone,tttwo,ttthree,tffour,tffive,tssix,tsseven,teeight,tnnine,thirty;
String thoone,thttwo,thtthree,thffour,thffive,thssix,thsseven,theeight,thnnine,fourty;
String ss21,ss22,ss23,ss24,ss25,ss26,ss27,ss28,ss29,ss30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,u41,u42,u43;

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<h5><body align=center bgcolor=silver>");
try {

out.println("<h3><form method=post action=\"SOC_Format_1\">");
HttpSession session=request.getSession();
String section= (String)session.getAttribute("section");
String unit= (String)session.getAttribute("unit");
String category= (String)session.getAttribute("category");
String rank= (String)session.getAttribute("rank");
String username= (String)session.getAttribute("username");
out.println("<marquee>"); out.println(" <br><br>ATG WELCOMES "); out.println(""+rank);
out.println(""+username); out.println(" OF "+section);
out.println(" / "+unit);
out.println("</marquee>");
out.println("Please don't exceed of 60 character /per column else SOC will not be saved");

if(category.equals("A")|| category.equals("B"))
{

out.println("<html>");
out.println("<head>");
out.println("<title>Raising of Demand in ATG ONLINE</title>");
out.println("</head>");
out.println("<body align=left bgcolor=silver>");

out.println("<table width=950 height=2000 align=justify>"); out.println("<tr >"); out.println("<td>");
out.println("<h3 ALIGN=RIGHT> APPENDIX 'B'");
out.println("<h4 ALIGN=CENTER> <u> FORMAT FOR THE STATEMENT OF CASE (SOC)</u><h4>");
out.println("<font ALIGN=justify> 1. Unit/Directorate/Office initiating the SOC <INPUT TYPE=TEXT name=one size=100> <br>" );


out.println("<font align=justify> 2. Name of the item(s)/services being procured <INPUT TYPE=TEXT name=two size=100>");
out.println("<br>"); out.println("<br>");
out.println("<font ALIGN=justify>      Category [Ex-ordance, Medical,IT, Engineering, MT, Electircal, Electronic, Clothing, Aviation, General, "
+ " FOL, Machinery, Spares, Communication, Navigational, Provisions, Weapons, Armament, Ammunition, Repairs, "
+ " Services and other categories (to be specified)");
out.println("<br>"); out.println("<br>");
out.println("(Nomenclature of items with details likepart numbers, etc to be shown in Annexure 'A' to the Statement of Case) ");
out.println("<br>"); out.println("<br>");
out.println("3. Justification for procurement. "); out.println("<br>");
out.println("     a. <INPUT TYPE=TEXT name=three size=100>Authority,if any, uder which the proposal is being initiated - Govt Rules "
+ "/Orders, Service specific instructions, Subsidiary instructions, etc. to be quoted.");
out.println("<br>");
out.println("     b. <INPUT TYPE=TEXTAREA name=four size=100> If it is a scaled item, - " );
out.println("Reference number and date of the Government letter/Service HQ letter authority "
+ "authorizing the scale to be quoted "); out.println("<br>");
out.println("     c. If it is a scaled item, the following information to be provided:");out.println("<br>");
out.println("         i. <INPUT TYPE=TEXT name=five size=100> Which item was serving the purpose till the date?"); out.println("<br>");
out.println("         ii. <INPUT TYPE=TEXT name=six size=100> How the present proposal will serve the purpose?"); out.println("<br>");
out.println("         iii. <INPUT TYPE=TEXT name=seven size=100> Whether scaling action has been initiated? if yes, "
+ " reference number to be given.If not , reason for not doing so to be given."); out.println("<br>"); out.println("<br>");
out.println("    d. Broad purpose of items being procured.<INPUT TYPE=TEXT name=eight size=100>"); out.println("<br>"); out.println("<br>");
out.println("    e. Detailed justification from user");out.println("<br>");
out.println("<font ALIGN=justify>         i. Category for proposal-"
+ "<select name=\"cat\">");
out.println("<option> ----- </option> ");
out.println("<option value=\"Fresh Purchase\"> Fresh Purchase</option> ");
out.println("<option value=Upgradation> Upgradation</option> ");
out.println("<option value=Replacement> Replacement</option> ");
out.println("<option value=Replacement> Maintenance</option> ");
out.println("<option value=Replacement> Repair</option> ");
out.println("<option value=Replacement> Any other </option> </select> ");
out.println("<br>");
out.println("             <b>* </b> Fresh Purchase ."); out.println("<br>");
out.println("             <b>* </b> Upgradation ."); out.println("<br>");
out.println("             <b>* </b> Replacement ."); out.println("<br>");
out.println("             <b>* </b> Maintenance ."); out.println("<br>");
out.println("             <b>* </b> Repair ."); out.println("<br>");
out.println("             <b>* </b> Any other ."); out.println("<br>"); out.println("<br>");
out.println("     ii. If it is a fresh purchase, the following information to be provided");out.println("<br>");
out.println("            <b>* </b> <INPUT TYPE=TEXT name=nine size=100> How was the purpose being served till date? "); out.println("<br>");
out.println("            <b>* </b> <INPUT TYPE=TEXT name=ten size=100> Why it can't be served with upgradation of the existing items ? "); out.println("<br>");
out.println("     iii. If it is a case of upgradation, the following information to be provided");out.println("<br>");
out.println("            <b>* </b> <INPUT TYPE=TEXT name=eleven size=100> Details of original purchase viz.,year, cost,quantity, "
+ " residual life after upgradation, etc.? "); out.println("<br>");
out.println("            <b>* </b><INPUT TYPE=TEXT name=twelve size=100> Confirmation that issues of standardization and "
+ " compatibality have been taken care of ? "); out.println("<br>");
out.println("     iv. If it is a replacement, the following information to be provided");out.println("<br>");
out.println("            <b>* </b> <INPUT TYPE=TEXT name=thirteen size=100> What will be done with the items being replaced ? "); out.println("<br>");
out.println("            <b>* </b> <INPUT TYPE=TEXT name=fourteen size=100> Details of proposal for disposal of "
+ " existing items (BER certificate,etc to be enclosed) "); out.println("<br>");
out.println("            <b>* </b> <INPUT TYPE=TEXT name=fifteen size=100> Possibility of buy-back or otherwise, along with reasons ? "); out.println("<br>");
out.println("4. Quantity "); out.println("<br>");
out.println("     (a) <INPUT TYPE=TEXT name=sixteen size=100> Basis of working out the quantity against each item- (formula, "
+ "methodology,etc.");out.println("<br>");
out.println("     (b) <INPUT TYPE=TEXT name=seventeen size=100> Details like authorised, holdings, existing holding, Dues-in, Dues-out, etc. ");out.println("<br>");
out.println("     (c) <INPUT TYPE=TEXT name=eighteen size=100> Calculation sheet/PR documents to be enclosed with the SOC. ");out.println("<br>");
out.println("     (Net Quantity to be shown in Annexure 'A') ");out.println("<br>");
out.println("     (d) <INPUT TYPE=TEXT name=nineteen size=100> Proposed distribution of items being beought with justification. ");out.println("<br>");

out.println("<br>");
out.println("5. Estimated cost of proposal- various elements of cost, such as the basic cost, taxes, transportation cost, training cost, AMC, etc., should"
+ " be shown seperately and the grand total should also be indicated. Basis for working out the estimated cost of proposal to be indicated "
+ " as follows: "); out.println("<br>");
out.println("     (a) <INPUT TYPE=TEXT name=twenty size=100> Last purchase price - Year, Escalation factor, source, quantity to be mentioned. ");out.println("<br>");
out.println("     (b) <INPUT TYPE=TEXT name=toone size=100> Budgetary quotes- Source,period, etc to be mentioned along with copy of budgetary quotes. ");out.println("<br>");
out.println("     (c) <INPUT TYPE=TEXT name=tttwo size=100> Market Intelligence - Source,period, etc to be mentioned along with relevant enclousers. ");out.println("<br>");
out.println("     (d) <INPUT TYPE=TEXT name=ttthree size=100> Rates obtained from other organisations- Source, period, quantity, etc to be mentioned along with relevant enclousers.");out.println("<br>");
out.println("     (e) <INPUT TYPE=TEXT name=tffour size=100> Professional Officers' Evaluation - Detailed reasoning and inputs used to be enclosed. ");out.println("<br>");
out.println("     (f) <INPUT TYPE=TEXT name=tffive size=100> Any other method adopted (to be specified and explained, along with reasons) ");out.println("<br>");
out.println("6. Details of last purchase");
out.println("<br>");
out.println("     (a) <INPUT TYPE=TEXT name=tssix size=100> The quantity and dates on which similar items were procured in last one year. ");out.println("<br>");
out.println("     (b) <INPUT TYPE=TEXT name=tsseven size=100> If it is a recurring item,the total period for which the items are being procured. ");out.println("<br>");
out.println("     (c) <INPUT TYPE=TEXT name=teeight size=100> The mode of tendering in respect of last purchase. ");out.println("<br>");
out.println("     (d) <INPUT TYPE=TEXT name=tnnine size=100> The source of last purchase.");out.println("<br>");
out.println("     (e) <INPUT TYPE=TEXT name=thirty size=100> Any other relevant information. ");out.println("<br>");
out.println("7. Availability of funds");
out.println("<br>");
out.println("     (a) <INPUT TYPE=TEXT name=thoone size=100> Is it included in the PPP (if applicable)? ");out.println("<br>");
out.println("     (b) <INPUT TYPE=TEXT name=thttwo size=100> If yes, relevant serial number of PPP to be quoted. ");out.println("<br>");
out.println("     (c) <INPUT TYPE=TEXT name=thtthree size=100> Major Head,Minor Head, Sub Head and Detailed Head under which expenditure "
+ " in respect of the instant proposal to be booked. "); out.println("<br>");
out.println("     (d) <INPUT TYPE=TEXT name=thffour size=100> Code Head, as mentioned in Classification Hand Book");out.println("<br>");
out.println("     (e) <INPUT TYPE=TEXT name=thffive size=100> Fund Availability certificate as per format given in Annexure B. ");out.println("<br>");
out.println("     (e) <INPUT TYPE=TEXT name=thssix size=100> Name of the Paying Agency. ");out.println("<br>");
out.println("8. Competent Financial Authority");
out.println("<br>");
out.println("     (a) <INPUT TYPE=TEXT name=thdseven size=100> Particulars of the Schedule / Sub-Schedule and the serial number thereof under which powers are being exercised ");out.println("<br>");
out.println("     (b) <INPUT TYPE=TEXT name=theeight size=100> Name/level of the CFA as mentioned in the Schedule, under whom the proposal falls ");out.println("<br>");
out.println("9. Mode of Tendering");
out.println("<br>");
out.println("     (a) <INPUT TYPE=TEXT name=thnnine size=100> Open tendering – Mention the websites and newspapers in which the advertisement is proposed to be published. (Draft advertisement to be enclosed) ");out.println("<br>");
out.println("     (b) <INPUT TYPE=TEXT name=fourty size=100> Limited Tendering – Mention the reasons for LTE if value of the proposal is more than Rs 25 lakhs. (The list of vendors for LTE and reasons for including them to be enclosed) ");out.println("<br>");
out.println("     (c) <INPUT TYPE=TEXT name=foone size=100> PAC tendering – Enclose draft PAC certificate along with detailed justification for PAC tendering. ");out.println("<br>");
out.println("     (d) <INPUT TYPE=TEXT name=fotwo size=100> Single tendering – Mention the grounds of urgency / Operation reasons / technical requirements, etc. on which STE is being proposed. ");out.println("<br>");
out.println("     (e) <INPUT TYPE=TEXT name=fothree size=100> Rate Contract – Enclose copy of relevant RC under which the items are being proposed to be bought. ");out.println("<br>");
out.println(" 10. Draft RFP ");
out.println("     (a) Draft RFP to be enclosed");
out.println("     (a) Special conditions applicable to the proposal, which have been proposed in draft RFP, to be highlighted in the SOC. ");
out.println("<br><br><br><br>");


out.println("<br>                                     "
+ "                                      "
+ "                                      "
+ "                              (______________)"); out.println("<br>");
out.println("<br>                                     "
+ "                                      "
+ "                                      "
+ "                 Officer initiating the proposal");

out.println("<tr><td> <FONT size=5 color=red ALIGN=RIGHT> <input type=submit value=\"Save SOC \"></td>");
out.println("<td ALIGN=LEFT> <input name=\"reset\" type=\"reset\" value = \"Refresh\">");
out.println("</td>"); out.println("</tr>"); out.println("</table>");

out.println("</form>");
out.println("</body>");
out.println("</html>");

}


}
catch(Exception e)
{
e.getMessage();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}


protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}
}




import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.HttpSession;
@WebServlet(name = "SOC_Format_1", urlPatterns = {"/SOC_Format_1"})
public class SOC_Format_1 extends HttpServlet {

Connection con; Statement stmt;
String str,unit1,fac1, item1,doq1,cat;
String qty1,rate1,amount1,query;
String one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty;
String s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20;
String s21,s22,s23,s24,s25,s26,s27,s28,s29,s30,s31,s32,s33,s34,s35,s36,s37,s38,s39,s40,s41,s42,s43;

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<h3><body align=center bgcolor=silver>");
try {
out.println("<html>");
out.println("<head>");

out.println("</head>");
out.println("<body align=center bgcolor=\"#6666ff\">");

HttpSession session=request.getSession();
String section= (String)session.getAttribute("section");
String unit= (String)session.getAttribute("unit");
String category= (String)session.getAttribute("category");
String rank= (String)session.getAttribute("rank");
String username= (String)session.getAttribute("username");
out.println("<marquee>"); out.println(" <br><br>ATG WELCOMES "); out.println(""+rank);
out.println(""+username); out.println(" OF "+section);
out.println(" / "+unit);
out.println("</marquee>");

if(category.equals("A")|| category.equals("B"))
{

out.println("<html>");
out.println("<head>");
out.println("<title>Raising of Demand in ATG ONLINE</title>");
out.println("</head>");
out.println("<body align=left bgcolor=silver>");
one=request.getParameter("one");
two=request.getParameter("two");
three=request.getParameter("three");
four=request.getParameter("four");
five=request.getParameter("five");
six=request.getParameter("six");
seven=request.getParameter("seven");
eight=request.getParameter("eight");
cat=request.getParameter("cat");
nine=request.getParameter("nine");
ten=request.getParameter("ten");
eleven=request.getParameter("eleven");
twelve=request.getParameter("twelve");
thirteen=request.getParameter("thirteen");
fourteen=request.getParameter("fourteen");
fifteen=request.getParameter("fifteen");
sixteen=request.getParameter("sixteen");
seventeen=request.getParameter("seventeen");
eighteen=request.getParameter("eighteen");
nineteen=request.getParameter("nineteen");
twenty=request.getParameter("twenty");
s21=request.getParameter("ss21");
s22=request.getParameter("ss22");
s23=request.getParameter("ss23");
s24=request.getParameter("ss24");
s25=request.getParameter("ss25");
s26=request.getParameter("ss26");
s27=request.getParameter("ss27");
s28=request.getParameter("ss28");
s29=request.getParameter("ss29");
s30=request.getParameter("ss30");
s31=request.getParameter("t31");
s32=request.getParameter("t32");
s33=request.getParameter("t33");
s34=request.getParameter("t34");
s35=request.getParameter("t35");
s36=request.getParameter("t36");
s37=request.getParameter("t37");
s38=request.getParameter("t38");
s39=request.getParameter("t39");
s40=request.getParameter("t40");
s41=request.getParameter("u41");
s42=request.getParameter("u42");
s43=request.getParameter("u43");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();

con=DriverManager.getConnection("jdbcdbc:JSY");
query="INSERT INTO SOCFORMAT (SOCNO,SOCDATE,S1,S2,S3,S4,S5,S6,S7,S8,CAT,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18)VALUES('"+one+"','"+two+"','"+three+"','"+four+"','"+five+"','"+six+"','"+seven+"','"+eight+"','"+nine+"','"+ten+"','"+eleven+"','"+twelve+"','"+thirteen+"','"+fourteen+"','"+fifteen+"','"+sixteen+"','"+seventeen+"','"+eighteen+"','"+nineteen+"','"+twenty+"')";
// query="INSERT INTO SOCFORMAT(S4,S5) VALUES ('"+s6+"','"+s7+"')";
// query="INSERT INTO SOCFORMAT(SOCNO,SOCDATE,S1,S2,S3,S4,S5,S6,S7,S8,CAT,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,S32,S33,S34,S35,S36,S37,S38,S39,S40,S41,S42,S43) VALUES('"+s1+"','"+s1+"','"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"','"+s6+"','"+s7+"','"+s8+"','"+cat+"','"+s9+"','"+s10+"','"+s11+"','"+s12+"','"+s13+"','"+s14+"','"+s15+"','"+s16+"','"+s17+"','"+s18+"','"+s19+"','"+s20+"','"+s21+"','"+s22+"','"+s23+"','"+s24+"','"+s25+"','"+s26+"','"+s27+"','"+s28+"','"+s29+"','"+s30+"','"+s31+"','"+s32+"','"+s33+"','"+s34+"','"+s35+"','"+s36+"','"+s37+"','"+s38+"','"+s39+"','"+s40+"','"+s41+"','"+s42+"','"+s43+"')";
// query="INSERT INTO SOCFORMAT (SOCNO,SOCDATE,S1,S2,S3,S4,S5,S6,S7,S8,CAT,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,S32,S33,S34,S35,S36,S37,S38,S39,S40,S41,S42,S43)VALUES ('"+s1+"','"+s1+"','"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"','"+s6+"','"+s7+"','"+s8+"','"+cat+"','"+s9+"','"+s10+"','"+s11+"','"+s12+"','"+s13+"','"+s14+"','"+s15+"','"+s16+"','"+s17+"','"+s18+"','"+s19+"','"+s20+"','"+s21+"','"+s22+"','"+s23+"','"+s24+"','"+s25+"','"+s26+"','"+s27+"','"+s28+"','"+s29+"','"+s30+"','"+s31+"','"+s32+"','"+s33+"','"+s34+"','"+s35+"','"+s36+"','"+s37+"','"+s38+"','"+s39+"','"+s40+"','"+s41+"','"+s42+"','"+s43+"')";

stmt=con.createStatement();
int zz=stmt.executeUpdate(query);

if(zz==1)
{
out.println("Successfully raised the SOC");
}
else
out.println("Couln't raised the SOC");
out.println("</body>");
out.println("</html>");


}

}
catch(Exception e)
{
e.getMessage();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}


protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}
}
Jasu Yadav
Greenhorn

Joined: Aug 14, 2011
Posts: 8
It works without inserting white spaces except four five strings with white spaces also
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
Any clue, which lines with white spaces are not working properly.

Its better to have an array for both the inputs and outputs, at least for the same group of inputs.


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Please follow the MVC architecture. Separate persistence logic and use jsp to render the view.


kunal
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
So much bad practice, for example, you never check any of the retrieved parameters for null.

Also, in the future when trying to get a answer here, don't dump hundreds of lines on us, all that printing of HTML just make it hard to see what you are doing.

Bill
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313

Agree with Bill and Kunal. You have merged everything into one piece of code (sorry, it is more than a piece).

You should follow the advice of Kunal.

Also, if you want any of us to identify where the issue lies, then please use Code tag. Edit your post.
Select the entire code and from the tool bar select Code. Click save and you are done.
Also, if it is possible then keep the length of a line to 80 or less so that it is clearly displayed on this page.


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
Jasu Yadav
Greenhorn

Joined: Aug 14, 2011
Posts: 8
Got it, it was a mistake in the proper sequence of parameters.
Thanks all for their valuable time and opinion.
Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

One suggestion, when you have this many parameters you should consider encapsulating them in a class, rather than having 43 distinct String objects.


And then in your servlet's processRequest method:


The biggest advantage is that you separate servlet logic from your data, which allows you to test the MyRequestData object independently of the servlet. It also gives you another chance to use more descriptive names for your data (so you might not be as likely to run into a problem with the "proper sequence".

OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: parameters in a servlet