Jsp newbie - quantity*price=�total - help!

Hi, im new to jsp and have made a few pages, and can display them using Tomcat, ive made a page counter and managed some validation of a form, but i cannot get this to work:
i have a form where you can select a product, then type in the price and quantity, so when you press order, it should display a page showing you what you chose and the total cost, (tryin to also use dp2??) , but im gettin in a right mess! i have ziped the two pages here: http://www.severnvalebathrooms.co.uk/ordermarbrex.zip
if someone could have a look, any help would be great!
thanks

what level feedback do you have on your server.
look at variable names,
you have:
<%
    String quantity    = request.getParameter( "quantity"    ); 
    String price       = request.getParameter( "price"      );
                                             // Create a convert for 2 decimal places
    java.text.DecimalFormat dp2 
                        = new java.text.DecimalFormat( "�#,##0.00" );
                                        // convert a string to type int                
    int    quantity = Integer.parseInt(   quantity ); 
                                        // convert a string to type double         
    double price    = Double.parseDouble( price    );
    String strips      = request.getParameter( "strips"      );     
    String whofor      = request.getParameter( "whofor"      );
    String bluemosaic  = request.getParameter( "bluemosaic"  );         
    String greenmosaic = request.getParameter( "greenmosaic" );         
    String beigemarble = request.getParameter( "beigemarble" );         
    String delivery    = request.getParameter( "delivery"    );
    if( bluemosaic  == null ) bluemosaic  = "";
    if( greenmosaic   == null ) greenmosaic   = "";
    if( beigemarble == null ) beigemarble = "";     
%> you should have like;
<% 
    String quantity    = request.getParameter( "quantity"    ); 
    String price       = request.getParameter( "price"      );
                                             // Create a convert for 2 decimal places
    java.text.DecimalFormat dp2 
                        = new java.text.DecimalFormat( "�#,##0.00" );
                                        // convert a string to type int                
    int    quantities = Integer.parseInt(   quantity ); 
                                        // convert a string to type double         
    double dPrice    = Double.parseDouble( price    );
    String strips      = request.getParameter( "strips"      );     
    String whofor      = request.getParameter( "whofor"      );
    String bluemosaic  = request.getParameter( "bluemosaic"  );         
    String greenmosaic = request.getParameter( "greenmosaic" );         
    String beigemarble = request.getParameter( "beigemarble" );         
    String delivery    = request.getParameter( "delivery"    );
    if( bluemosaic  == null ) bluemosaic  = "";
    if( greenmosaic   == null ) greenmosaic   = "";
    if( beigemarble == null ) beigemarble = "";     
%> then change output vars to reflect this at bottom of page.
also i would do some checking of input vars
try calling this;
process_marbrex.jsp?quantity=xyzkind regards,
g00fy

Similar Messages

  • JSP newbie file I/O help

    I realize that appending to a text file has been covered on a few other discussions, but I am new to JSP and I am in dire need of assistance.
    What I am trying to do is append to a text file a tab delimited string that is coming from a form submission.
    Thanks in Advance,
    Reid
    <%@ page import="java.io.*" %>
    <%
    String str = "print me";
    String nameOfTextFile = "what.txt";
    try {  
    PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
    pw.println(str);
    //clean up
    pw.close();
    } catch(IOException e) {
    out.println(e.getMessage());
    %>

    try this:
    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("Test.txt",true)));
    The true value tells it to append to the specified file

  • How do I use acrobat to calculate quantity/price as a form?

    Hello, I am trying to find out how to complete a form in acrobat pro using fields to calculate quantity/prices, ending in the field "TOTAL". This form is designed in illustrator. Here is a picture of the form: http://db.tt/gJsLWngT  Can anyone help me complete to process? If I am taking the wrong approach to this please let me know. I would greatly appreciate it, thank you.

    You need to place text fields as your Quantity and Total columns, 2 in each
    row.
    For example, in the first row you can create: Quantity1 and Total1
    Set up the quantity fields to accept only numbers (under Format).
    The total fields should be set to be read-only, and under Calculate you can
    use the Simple Field Notation to calculate their value.
    In the case of Total1, you can use something like this (for the retail
    price):
    Quantity1 * 35
    The value will be automatically updated whenever the value of Quantity1
    changes.
    For the last total field, use the first calculation option: Value is the
    (sum) of... and then select all the other total fields from the list.
    There are many more things that you can do...
    The tutorials on this website contains a lot of information about forms in
    PDF files:
    http://acrobatusers.com/tutorials

  • Jsp newbie having trouble using JSP's with Jdev 10.1.3

    Hi,
    Have been bashing my head for about two hours with this, if anyone can help will substantially improve my life.
    First off apologies if question is stupid or obvious I am a jsp newbie.
    Have been experimenting with using the Jsp Taglibrary for tabbed panes in a browser.
    http://www.ditchnet.org/tabs/
    I have followed all the installation instructions but in JDeveloper when I build I get the message
    Error(18,2): method setJspContext(javax.servlet.jsp.PageContext) not found in class org.ditchnet.jsp.taglib.tabs.handler.TabConfigTag
    Any idea what jar file I'm missing.
    I'm a bit lost, thanks

    Arrrrrrrrgh,
    Sorted my problem.
    Rebuilt project, works fine now, no idea what was going on (just generally!).
    Thanks for input Shay
    Mark

  • My app store is not working after installing mavericks. When I open app store it repeatedly asking me to login with apple ID and to provide User name and Password for proxy authentication in a loop.I am a newbie to mac,Please help me.

    My app store is not working after installing mavericks. When I open app store it repeatedly asking me to login with apple ID and to provide User name and Password for proxy authentication in a loop.I am a newbie to mac,Please help me.

    Hmmmm... would appear that you need to be actually logged in to enable the additional menu features.
    Have you tried deletting the plists for MAS?
    This page might help you out...
    http://www.macobserver.com/tmo/answers/how_to_identify_and_fix_problems_with_the _mac_app_store
    Failing that, I will have to throw this back to the forum to see if anyone else can advise further.
    Let me know how you get on?
    Thanks.

  • Quantity & price  difference between purchase order and goods receipt

    goods receipt against purchase order
    inventory a/c    dr
       gr/ir clearing a/c    cr
    if there is any quantity & price  difference in between PO and GR  ex-  PO order -1000 bags @ rs 10  but good receipt 900 @ Rs 10
    then how the price difference and quantity diference treated in sap
    what will be the entries, how we adjust it.
    regards
    siba

    kindly note that depending on the Moving average or standard price (price control flag in mm01) the difference will either get adjusted with the material or to the price difference account accordingly.
    in the example for standard price
             gr for po :10 bags @ 11
    dr stock 100
    cr gr/ir 110
    dr price diff 10
    the above is in case of material maitained at 'Standard price' in the mm03.
    regards
    eashwar

  • How to construct table in jsp for the resultset from helper class

    Hi Dudes!!!
    Want to construct table in jsp for the resultset, but the resultset are retrieved at the helper class.I constructed Table in Helper class Using StringBuffer and return it as string from the helper class.Is their any other feasible and efficient way to construct table in Jsp for the resultset from Helper class.Solution will be highly appreciated.Thanx in Advance.

    no, we can't.
    Certainly noone can with such vague specifications even if they had the intent to do so.
    "the computer", which computer?
    "attach to our current page", what is meant by that?
    And noone should ever help you if you're planning to breach security anywhere.

  • Hi! I am newbie to Reports need help with check boxes

    Hi! I am newbie to Reports need help with check boxes. I am try-in to make a new check boxes that will validate in runtime. I have created two frames and one frame is dummy and other frame has big X line on it with conditions. Is this a right way to create check box! Please help thanks!

    and one frame is dummy and other frame has big X
    line on it with conditions. Is this a right way to
    create check box! Please help thanks!Instead of creating a frame for X, you can create Ractangle and place X in it. Rest is fine.

  • How to change price total for "Change Unit Cost Estimate Screen" for KKE1 Tcode ?

    There is a requirement of bringing the Material Price in KKE1 while entering the Item Catogory M ( M for Material) from the Gross Price in the condition type (P001) that is entered in the Purchase order.Currently systems brings the material value from MAP(Moving average Price) in the Material Master data.
    I have looked into the user exit 1) EXIT_SAPLKKEC_001 2) EXIT_SAPLKKEC_002  available in this T code KKE1.When I put break-point in these user-exit,it is not going in debugging mode while fetching the price value in Price total column  for "Change Unit Cost Estimate" screen in KKE1.
    How will change pricing condition for material in KKE1?
    I want to change price condition for material  as marked in red as shown in the screen-shot.
      Where will write the code such that I will bring Price Total based on material number as shown in the image?

    Hi Ram,
    I think you can do the same in thei manner.
    Go to program SAPMV45A.
    use menu GOTO -
    > Text Elements----
    >Text Symbols
    Here make change of Text-002 Sold-To Party as saleable .
    Regards,
    Pravin

  • Can I  use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Can I use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Let me tell you what I am sure about and what I am not sure about:
    I am sure that I want to be able to sell my products online. The industrial market that I sell to usually do not allow the maintenance people that find me on the web, do not have the ability to use credit cards in a typical shopping cart format due to the higher prices that the equipment I sell costs and that most people call me up to 'request a formal quotation' to give to their purchasing depart. So, my bright idea is to create numerous pdf files with very specific url's to match the very specific items that I sell. (1) item per pdf. I am thinking that the advantage to skipping the shopping cart approach and allowing the customer to fill in the qty of items, which would be mulitpled by the price of the item (a constant #) and then hitting a apply button, that would calculate subtotal price. Discounts for the qty the customer inputs (qty of items inputted by customer would be discounted on a percentage x base price) and a refresh the screen. It would allow for SEO advantages from what I have seen in the past in my very vertical market. All forms would be setup using the same functionality, just images, alt text, urls, and readable text would change.
    What I don't know- which is alot, then how to calculate shipping costs. I have a weight per item, which can be added up. I saw an Adobe blog that allows UPS shipping cost to be programmed in. I don't know how dreamweaver works, which was what the blog mentioned would allow for this updated, instantanious interface with UPS and calculating real shipping costs to a specific zip code. Shipping cost would be fluff to this page. The main thing would be to do allow the customer to be able to fill in a qty of the specific item on the page, calculate a discount if / then type thing, be able to have customer email to purchasing dept or print. I would date stamp it with verbage that pricing is valid for XX days and if I could get a copy emailed to me that would be icing on the cake. I believe that this non static pdf would be something different then the current competion and that it would allow for 100's of quotes to be generated without customers having to wait 15 minutes to an hour for me to process the exact document that they are looking for.
    Hajeks

  • I bought(own) and gifted(friend) an app which i was charged 2 different prices please help me with this!!!

    I bought(own) and gifted(friend) an app which i was charged 2 different prices please help me with this!!!

    Apple does not sell an unlocked iPhone. Some cell carriers offer the option to purchase an unlocked phone at a significantly higher price. Your friend could go to Hong Kong and buy an unlocked phone from an authorized carrier but if he has any problems with the phone, he will need to take it back to the country where he purchased it.

  • Quantity price breaks

    Hello!  Using hierarchies & expansions for quantity price breaks is too time consuming.  Is there a better way?  We currently are applying price breaks to each item 4 times.  Each instance represents each price list used.  This practice is redundant to say the least.  Is there a global quantity break for all price lists?

    I am currently developing an enhancement to the Special Prices specific to a customer's need.  It will enable the user to Add a <b>Single</b> Period Driven "Disc%" & "Price After Disc" to <b>Multiple</b> Items within a Special Price List for Partner.  This is because the customer has Multiple Items that have the Same Period Driven Price and are managed simultaneously.  So, instead of the User entering the same item's Period Deal to one Item at a time (time consuming and duplication), the items' Period Deal can be added to multiple Items at ONE GO by selecting/highlighting multiple Items in the Special Prices Form.  I have not attempted the adding of Quantity Driven Deals as YET, but i will be in the comming weeks.
    I am confident that it CAN be done using the SDK but there are some minor drawbacks to concider...like the selection of Price List from the ComboBox to use in the Period will not bring forward the current Item's Base Price List Value.

  • Quantity and Price Totals on Sale Order and Delivery Order

    Dear ABAP Gurus,
    I want to add totals of line items (Quantity and Price) in sale order and delivery order screens. Can you please guide me how to do this. The price can be any from pricing procedure ie exclusive or inclusive price of sales tax.
    regards,
    RSA
    Moderator message : Requirements dumping not allowed, show the work you have already done, thread locked.
    Edited by: Vinod Kumar on Jan 28, 2012 9:23 PM

    Hi,
    Try this :
    IF @transaction_type in ('A','U') AND (@OBJECT_TYPE='22')
    BEGIN
    If exists (SELECT t3.docentry FROM OWOR T0  INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry left join POR1 T2 on T2.[U_JONum] = T0.[OriginNum] and  T0.[ItemCode] =  t2.U_SubConItem] INNER JOIN OPOR T3 ON T2.DocEntry = T3.DocEntry WHERE T1.[PlannedQty] <> T2.[Quantity] and  T1.[ItemCode]  = 'subcon' and  T3.DocEntry = @list_of_cols_val_tab_del )
    Begin
    SET @error = 10
    SET @error_message = 'Not allowed to add more than planned'
    End
    End
    Thanks & Regards,
    Nagarajan

  • Jsp newbie, please help about @include

    I am new to JSP.
    I have two jsp files, say , jsp1 and jsp2.
    JSP2 is perfectly working. I want to display the result of jsp2 with the result of jsp1.
    But I additionally want to supply a value from jsp1 to a variable in jsp2 before calling jsp2.
    The result of jsp2 depends on the value supplied.
    I couldn't figure out how to do this. A simple @include directive like
    <%@ include file="jsp2.jsp" %> doesn't seem to be suitable here.
    What options are available here? Please help.
    Thank you.

    Thank you friends for the suggestion. I have yet to try your suggestions.
    Before that I came across another problem. Would someone help please?
    Why the jsp fails when I include the same JSP page twice in another jsp page?
    Of the following two jsp files, the upper one is OK, but the lower one complains that it cannot compile (org.apache.jasper.JasperException).
    test1.jsp:
    <html><head><title></title></head>
    <body>
    <table>
    <tr><td><%@ include file="single.jsp" %></td></tr>
    </table>
    </body>
    </html>
    test2.jsp:
    <html><head><title></title></head>
    <body>
    <table>
    <tr>
    <td><%@ include file="single.jsp" %></td>
    <td><%@ include file="single.jsp" %></td>
    </tr>
    </table>
    </body>
    </html>
    I want to populate the cells of an HTML table with the results from the same jsp file, by supplying different values to a variable in the jsp file so that its results will be different for each cell. Am I being to foolish here?
    Thanks.

  • JSP Newbie need help

    Hi to all,
    I'm very new in using JSP, I was debugging an existing JSP codes when I encounter this problem. There's this two files these are as follows:
    resourcecenter_requestinfo.html / resourcecenter_requestinfo.jsp
    contact_requestinfo.html / contact_requestinfo.jsp
    From what I have observe there's a confilict on the _requestinfo subtitle part of the filename because when I try to execute this code the template for contact and resourcecenter overlapped. What I mean by overlapped is both output of those template appears after execution.
    I hope someone could help me on this or give me some tips.
    Thansk in advance....!
    Regards,
    John Drayton C. Fule
    Jr. Systems Engineer
    Imperium Techonology Inc.
    Philiipines

    ok thanks I double check it and try to rename it and it works. But another problem occurs. The looks of the output it not what I expected. some colors turned to red. Is there any way i can determine why it happen.

Maybe you are looking for

  • A link to other pdf files not working in only Android OS. How Can I fix it ?

    If there is many folders and pdf files in there  and a pdf file is at root and the root pdf file has many link to pdf files. In Windows OS links work well. but In Android OS, not working. when I click links, there is no difference. How can I fix it?

  • Point me in the right direction: want to resize image & store in mysql db

    I finally accomplished one of my tasks! Which was trying to upload a jpeg image into my mysql database, and then display it in a jsp page via a servlet. I extend my thanks to the java forums greatly:) Now my next task I find is going to be trickier t

  • When should SAP Country Versions be activated ?

    Should SAP Country Versions be activated within the Global SAP Template prior to the wave roll outs to avoid retrofitting during the waves? Situation: We have completed the global SAP template and are ready to roll it out to 50 countries. Wave 1 (of

  • Policy Issue

    Hi I have a normal user policy apply at the OU level to restrict some desktop setting like accessing control panel, changing wallpaper, and so for, and the OU container has 10 users which get the normal user policy applying onto their desktop everyti

  • Onclick Highlight Row

    Apex 4.2 I have a tabular form. Once a user clicks a row, I would like to highlight the background of that row. How do I acheive this ? Gus