Servlet not forwarding a control to the jsp with req dspher

hi ppl,my servlet code is supposed to forward a control to a jsp page so as to display the value in the jsp.but the request dispatcher's forward is not forwarding the control to the jsp page.....here is my servlet code----
// Decompiled by DJ v3.4.4.74 Copyright 2003 Atanas Neshkov  Date: 7/4/2003 12:37:00 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name:   BdgtMaster.java
package publicity;
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class BdgtMaster extends HttpServlet
    public synchronized void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws ServletException, IOException
        Object obj = null;
        String s3 = "";
        String s4 = "";
        out = httpservletresponse.getOutputStream();
        String s = "";
        String s1 = "";
        String s2 = httpservletrequest.getParameter("option");
        s3 = httpservletrequest.getParameter("branch");
        s4 = httpservletrequest.getParameter("publicity_code");
        String s5 = httpservletrequest.getParameter("budget");
        try
            String s6 = "0";
            String s7 = "0";
            String s8 = "INSERT INTO Budget_Master(Branch,Publicity_Code,Budget_Alloted,Work_In_Progress,Amount_Paid) VALUES (?,?,?,?,?)";
            String s9 = "update budget_master set old_budget = budget_alloted where branch='" + s3 + "' and publicity_code=" + s4;
            String s10 = "UPDATE Budget_Master set budget_alloted=" + s5 + " where Branch='" + s3 + "' and publicity_code=" + s4;
            datasource = "jdbc:odbc:budget";
            con = DriverManager.getConnection(datasource);
            int i = con.getTransactionIsolation();
            con.setTransactionIsolation(2);
            con.setAutoCommit(false);
            if("new".equalsIgnoreCase(s2))
                PreparedStatement preparedstatement = con.prepareStatement(s8);
                preparedstatement.setString(1, s3);
                preparedstatement.setString(2, s4);
                preparedstatement.setString(3, s5);
                preparedstatement.setString(4, s7);
                preparedstatement.setString(5, s6);
                preparedstatement.executeUpdate();
                con.commit();
                preparedstatement.close();
            if("update".equalsIgnoreCase(s2))
                Statement statement = con.createStatement();
                statement.executeUpdate(s9);
                statement.executeUpdate(s10);
                con.commit();
            con.setTransactionIsolation(0);
            /*htmlStart(out, "BUDGET MASTER");
            out.println("<p> </p><div align=\"left\">");
            out.println("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"50%\">");
            out.print("<tr>");
            out.println("<td width=\"50%\"><strong><small><font face=\"Tahoma\">Branch </font></small></strong></td>");
            out.println("<td width=\"50%\"><small><font color=\"#004080\" face=\"Tahoma\">" + s3 + "</font></small></td></tr><tr>");
            out.println("<td width=\"50%\"><strong><small><font face=\"Tahoma\">Budget Alloted </font></small></strong></td>");
            out.println("<td width=\"50%\"><small><font color=\"#004080\" face=\"Tahoma\">" + s5 + "</font></small></td></tr><tr>");
            out.println("<td width=\"50%\"><small><strong><font face=\"Tahoma\">Publicity Code</font></strong></small></td>");
            out.println("<td width=\"50%\"><small><font color=\"#004080\" face=\"Tahoma\">" + s4 + "</font></small></td></tr></table></div>");
            htmlEnd(out);
          con.close();
            httpservletrequest.getRequestDispatcher("/pages/serview/BdgM.jsp").forward(httpservletrequest,httpservletresponse);        
        catch(SQLException sqlexception)
            cleanUp();
            printSQLException(sqlexception, out);
        out.flush();
    public void init(ServletConfig servletconfig)
        throws ServletException
        super.init(servletconfig);
        try
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            return;
        catch(ClassNotFoundException classnotfoundexception)
            log("Couldn't load class sun.jdbc.odbc.JdbcOdbcDriver");
            throw new ServletException(classnotfoundexception.getMessage());
    static void printSQLException(SQLException sqlexception, ServletOutputStream servletoutputstream)
        throws IOException
        servletoutputstream.print("<b>SQLException</b>\n<p>\n\n");
        for(; sqlexception != null; sqlexception = sqlexception.getNextException())
            servletoutputstream.print("<b>SQLState:</b> " + sqlexception.getSQLState() + "<br>\n");
            servletoutputstream.print("<b>Message:</b> " + sqlexception.getMessage() + "<br>\n");
            servletoutputstream.print("<b>Vendor:</b> " + sqlexception.getErrorCode() + "<br>\n");
    private static boolean checkForWarning(SQLWarning sqlwarning)
        throws SQLException
        boolean flag = false;
        if(sqlwarning != null)
            System.out.println("\n *** Warning ***\n");
            flag = true;
            for(; sqlwarning != null; sqlwarning = sqlwarning.getNextWarning())
                System.out.println("SQLState: " + sqlwarning.getSQLState());
                System.out.println("Message:  " + sqlwarning.getMessage());
                System.out.println("Vendor:   " + sqlwarning.getErrorCode());
                System.out.println("");
        return flag;
    /*void htmlStart(ServletOutputStream servletoutputstream, String s)
        throws IOException
        servletoutputstream.println("<html><head><title>" + s + "</title></head>");
        servletoutputstream.println("<body topmargin=\"0\" leftmargin=\"0\" bgproperties=\"fixed\">");
        servletoutputstream.println("<div align=\"left\"><table border=\"0\" width=\"100%\">");
        servletoutputstream.println("<tr><td width=\"100%\" bgcolor=\"#DFDFFF\">");
        servletoutputstream.println("<font face=\"Tahoma\" color=\"#000000\"><strong>B u d g e t   M a s t e r - D e t a i l s   E n t e r e d</strong></font></td>");
        servletoutputstream.println("</tr></table>");
    void htmlEnd(ServletOutputStream servletoutputstream)
        throws IOException
        servletoutputstream.print("<hr>");
        servletoutputstream.print("</body></html>\n");
    String link(String s, String s1)
        return "<a href=\"" + s + "\">" + s1 + "</a>";
    public String getServletInfo()
        return "Display and SQL manipulate JDBC databases on the server.";
    public void cleanUp()
        throws IOException
        if(con != null)
            try
                out.print("Closing database connection");
                con.setTransactionIsolation(0);
                con.close();
                return;
            catch(SQLException _ex)
                return;
        else
            return;
    public BdgtMaster()
    private Connection con;
    private String datasource;
    private String user;
    private String password;
    private String base;
    private ServletOutputStream out;
plz tell me where im wrong...
regards....a_joseph

Hi,
Sorry to say this but it'd be lot simple if we can avoid cross posting similar Queries.
I'd appriciate if you can continue using with your post
http://forum.java.sun.com/thread.jspa?threadID=5208928
Hope there are no hard issues on this.
REGARDS,
RaHuL

Similar Messages

  • The Control A key is not working. I cannot multi-select my songs. I'm not sure if it is the problem with iTunes 10.6.1.7 or my PC settings encounter issues. Also, i cannot find Album Artwork online using iTunes and i cannot select any view form but List.

    The Control A key is not working. I cannot multi-select my songs. I'm not sure if it is the problem with iTunes 10.6.1.7 or my PC settings encounter issues. Also, i cannot find Album Artwork online using iTunes and i cannot select any view form but List.

    The Control A key is not working. I cannot multi-select my songs. I'm not sure if it is the problem with iTunes 10.6.1.7 or my PC settings encounter issues. Also, i cannot find Album Artwork online using iTunes and i cannot select any view form but List.

  • Photo shop is not allowing me to use the "Intersect with current selection"

    Photoshop is not allowing me to use the "Itersect with current selection" marquee. (The "UNION" between two selection marquees.) When I press the [Shift] + [Option] keys while dragging on a first selection marquee, this just creates a new selection and removes the old selection. I have also tried using the "intersect with selection" icon which is not working either.

    Lack of experience possibly'.
    To get the 360 degree scroll you need to be 'zoomed in' closer (than 1:1) to a picture or web page so that it is too large to fit on your screen.
    As you know, with Windows you need, at all times' to scroll the bars at the bottom and/or right of the screen to move the display around (a little like an altazimuth telescope is manouvred). Also, if you accidently leave the scroll bar when dragging, the screen immediately snaps back to where you started from rather than knowing how far down you got before your cursor moved off the bar (if it did). You are certain to know what I mean.
    If you are similarly 'zoomed in' to a picture on your new Mac, you don't necessarily need to click and drag on the scroll bars at the bottom (or right) of the window, or use the scroll wheel to move the screen vertically. With your Mac, when zoomed in to a greater than 100%, the mouse allows one toscroll 360 degrees with the mouse - not just vertically. But the picture (or web page needs to be zoomed in somewhat - i.e. greater than 1:1)
    With Web pages in Safari and any other Web Browser (with the possible exception of IE with which I have had no experience with sometime before 2002 and I have only 'heard' that it doesn't work ), if you use the keys 'cmd and '+" together.
    At he end of the day, you just need to keep exploring your new Mac and have fun finfing all the added extras for yourself.
    (There's do many little treasures, it just gettng the time to find them all, in my experience.)

  • This may seem basic, but I just discovered that I do not have a share button (the thing with the little arrow popping out) to the left of my address bar on my Mac.  I do have one on my IPad and really like it.  Why don't I have this on my Mac?

    This may seem basic, but I just discovered that I do not have a share button (the one with the little arrow jumping out) to the left of my address bar on Safari for my Mac.  I do have one on my IPad and use it often.  Can anyone tell me why my Mac is missing this icon and how to get it?  Thanks.

    lawrencefromgettysburg wrote:
    I went in to do the software update, and learned that my software is up to date.
    Going from Lion to Mountain Lion is considered an upgrade (because it is not free), not an update.
    So yes, given that you have Lion, you are up to date.  But if you can, you might consider going to Mountain Lion for a fee.
    Here's what you need to do the upgrade:
    System requirements for OS X Mountain Lion

  • Firefox dose not refresh while ie refreshes the JSP page

    Hiii,
    I think I am in a little tricky situation here and need for your advice,
    here is the situation...
    I have a small .jsp page that contains a little jsp code and a little html code ...
    the main function of the jsp part is the adjust the "refresh content" destination...
    this is the code ..
    if (abs==1
         toGo = "a.jsp";
    if (abs==2)
              toGo = "b.jsp";
    if (abs==3)
                   toGo = "c.jsp";
    if (abs==4)
         toGo ="d.jsp";
    %>
    <meta http-equiv="REFRESH" content="10; url=<%=request.getContextPath()%>/en/<%=toGo%>">
    this code works fine in ie,
    ie, refreshes the page and decide where to go ...
    however firefox (and mozilla, may be netscape too) .. dose not refreh .. so the page stays...
    actually they are porbably refreshing but it seems that they are not running jsp again and again ..
    where is the problem ? ..
    How should I solve this problem ...
    Thank you..

    actually it makes sense but It is not working..
    event if I adject the refresh path like,
    <meta http-equiv="REFRESH" content="10; url=http://www.yahoo.com/<%=request.getContextPath()%>/<%=lang%>/event/Proposal/<%=toGo%>">
    it is not reporting an error... .. (page not found :) ) .... but it refreshes... I mean If I change the content of the html part, I get the changes from browser.. but the page is still there..

  • Help: OJSPC can not compile the JSP with struts tag

    Hi,
    I am trying to precompile the JSP page with EAR package but OJSPC can not parse the Struts tags.
    I always get oracle.jsp.parse.JspParseException:
    Error: org.apache.struts.taglib.html.MessgesTei while reading TLD /WEB-INF/tld/struts-html.tld
    My OC4J version is 10.1.3.2 and I did tried putting the struts-taglib.jar to /opt/oracle/product/app10g/j2ee/home/jsp/lib or /lib/taglib
    but still do not work.
    Can anyone tell me how to configure the OJSPC and let it support customerized taglibs?
    Thanks a lot!

    This is a new problem with jdk1.4 when compiling with tomcat.
    The solution is to ensure that any classes in WEB-INF/classes are in a package structure and the relevant jsp calls the same using the package name.
    best
    kev

  • Jsf 1s phase of life cycle how knows ths components of the jsp with jsf tag

    i wish to know how faces servlet knows the jsp s view components while creaTI NG component tree at first request to input jsp which may have jsf tags.in the first phase faces servlet doesnot know input jsp with jsf tags what componnets it has. it is actually atthe response send or forward time which is the final phase when the tag ge executed and output is sent to client.i did understandin jsf life cycle in 1 st phase component tree is created at first request in 1 st phase .

    Hi,
    though a FacesContext holds the values used by a request, it doesn't mean it lives for as long as the request. The best explanation I found is from the JavaDocs
    release
    public abstract void release()
    +Release any resources associated with this FacesContext instance. Faces implementations may choose to pool instances in the associated FacesContextFactory to avoid repeated object creation and garbage collection. After release() is called on a FacesContext instance (until the FacesContext instance has been recycled by the implementation for re-use), calling any other methods will cause an IllegalStateException to be thrown.+
    The implementation must call setCurrentInstance(javax.faces.context.FacesContext) passing null to remove the association between this thread and this dead FacesContext instance.
    Throws:
    java.lang.IllegalStateException - if this method is called after this instance has been released
    Frank

  • Fan control on the G450 with Windows 7

    Hello to everyone!
    A lot of you might know that when Windows 7 launched, there was a week of "windows 7 deals" from Lenovo.
    Since I'm off to college in a year, I couldn't of brought a great laptop (like a $1000 model), so I stuck with the ideaPad G450 from Lenovo (949CHU) which I think was on day 3. I didn't want a 15" inch laptop, since I'm blind, so really screen did not matter - in deed this laptop has 32 MB of dedicated graphics ram which is way to little!
    Anyway. I got the laptop yesterday, and it came with Windows 7 x64. My screen reading software currently only has an x86 release, so I decided to format the laptop with my own Windows 7 copy.
    w
    indows 7 installed very fast (I really just love the speed on this laptop!)
    I went on the drivers folder in my Lenovo partition (I didn't repartition the disk, thinking that I could somehow save the IBM_service partition for later recovery/exporting to a DVD image, but that's a whole other issue)
    I installed the energy ssaver driver. Since it was only in an x64 distribution, I downloaded it from Lenovo's site.
    But I've noticed that the laptop's fan is constantly on. I don't know why, but it just never stops! It's not too loud or anything (just a tad bit, especially in my bedroom), I'm simply wondering what's up with this.
    Is there some kind of driver I need to get that'll enable Windows to control my fan spin? Or is my only option to just have it run and run and run?
    Thanks so much for your help
    With all due respect-
    Tomi

    Hi
    With the help of  Google translate, I was able to get the program up and running. (there wasn't an english.lang file on the site, so I just used google translate to make my own).
    It's a very neat program but sadly it won't change my fan settings, no matter how much I move the sliders around. The temperature sensors also show 0 ºC (there are 7 listed).
    So I'm assuming that the program isn't detecting my laptop's fan settings fully (though it does find a battery).
    Very odd...
    With all the best-
    Tomi

  • Can I get stepped out put voltage signal for controls from the BNC with Labview?

    Hi!
    I am new user to NI Labview. I am working in controls applied in Combustion sciences. I want control the Solenoid valve ( Jefferson made,230 V, 11 W) in stepped manner. BNC (2110) is used for the input signal (Piezoelectric pressure transducers) and output signal. The maximum out put voltage from BNC is 5 V. Can I get the out put voltage in stepped and increasing order to ensure the better controls of the solenoid valve?
    Also I would like to know, is it possible for me to control the working frequency ( Injecting) of the solenoid valve with the help of Lab view?
    Thanks.
    With Regards,
    Ganesh

    Just having the same issue there, which is real not fun, I have not tried to contact them, but looking at  your experience I am not sure if I should.
    My key comes from the back of a laptop o so I guess that would be a W7
    OEM, and that could explain why you can't download a ISO from their website, would that also your case ?
    Also could it be because we are attempting to get the ISO after the product became EOL ?
    http://windows.microsoft.com/en-us/windows/lifecycle
    Maybe I will give a go with the customer care people and maybe I will get a right answer ;)
    Will keep you posted

  • Forwarding an email on the iPhone with an attachment fails

    I'm not sure when this problem started but it's been going on for at least a week or two, possibly longer. I am operating at the latest firmware version (2.1).
    I do not use Mobile Me.
    If I send a pdf, gif, jpg attachment in an email from my work account, for example, to my Yahoo account that works. I go to the Yahoo account email on the iPhone and read the email and view the picture.
    If I FORWARD the email to another person and choose to include the attachment, the email does not get sent. I get the error, "Cannot Send Mail - An error occured while delivering this message". The forwarded email sits in the Outbox and the iPhone periodically tries to send it but it never works.
    I tried deleting the Yahoo account off the iPhone and then re-adding as was stated in one discussion but this did not work.
    Is this an iPhone or Yahoo problem?
    Thanks, Matt

    I have the same problem with my email address. It started about a week ago. It won't forward attachments but works fine with just text. If I use my wife's Yahoo address which is a sub account of mine it works fine. Exactly the same settings in both cases.
    Even tried it on a different iphone and I get the same result.
    My email does work fine though through Webmail and through Mail on the Mac or Outlook.
    I'm betting it must be Yahoo though.
    Yahoo have been'improving' their SMTP spam protection and I don't know if it has caused something on my Yahoo account to block anything with an attachment that comes from the iphone.
    I tried calling them about it and after about an hour I convinced the 'technical support guy' (term used loosely) to see if there something different between the settings on the two accounts or to see if there was a message stuck in the system somewhere causing a blockage from the iphone. That's when the call dropped off and losing the will to live, gave up on talking to them.
    I did put it in e-mail and may get a response if they pass it on to a real Technical advisor.
    Will post again if I have any luck!

  • I'm not able to access to the internet with my ipod ..help! Non riesco a connettermi su internet via wi-fi !

    Salve, ho appena comprato il mio ipod di 8G..  connettendomi wi-fi al router di casa mia, aprendo safari (o le altre applicazioni che richiedono la connessione internet) spunta la finestra con scritto "Impossibile aprire pagine, Safari non può aprire la pagina perché non è connesso a Internet" Ho provato e riprovato, ma niente! Spero possiate aiutarmi, grazie! :)
    Hello, I've just bought my ipod (8Gb)... even with the wi-fi I'm not able to access to the internet, opening any app that needs internet my ipod shows this " Cannot open page, Safari cannot open the page because it is not connected to the internet"  I tried and I tried but it was useless..! I hope You can help me! Thank you and sorry if my english isn't right

    I can connect to the site using another computer on my network. It's completely isolated to my iMac.

  • HT1689 me and my husband both have iphones 4 on the same itunes account but he cannot purchase anything cuz it keeps sayin its a new device and he needs to answer security questions.the questions are not what we set up the acct with. help!

    My husband and I both have i phone 4 on the same itune acct but his phone is saying its a new device and will not let him buy anything off of our acct without answering security questions.  these questions are not the ones we set up the acct with. my iphone device is not having this problem. Help!

    I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
    What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
    Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
    Thanks again for "anyone" that can help me!!!

  • Mifi 4510 and not being able to use the internet with my Ipod touch

    My mifi 4510 will not allow my iPod Touch to connect to the internet.  In settings it sees my device and for about 2 seconds a dot will appear of the screen of the mifi4510.  The dot goes away and it keeps searching endlessly to connect to my iPod Touch.  I have talked to the first level of tech support and they tell me that the iPhone and iPad are compatible with the 4510, but not the iTouch.  I can take my iTouch to any other wireless network, enter the key and the network will connect flawlessly to my device.  First level of tech support also asked if I had the latest updates to my iPod Touch  The answer is yes.  If in fact Verizon is blocking the iPod Touch from going out onto the internet, can anyone give me the rationale as to why this would be true.
    AJO65

    Hello,
    I am not aware of any limitations on the MiFi that would back up Verizon's story.  If the device is Wi-Fi compatible then it should be able to connect to the MiFi 4510L.  The only reason why a device might not be able to connect would be due to wireless passwords not matching or the MiFi broadcasting in a mode which is incompatible with that device.
    Here are some quick suggestions which may help:
    Change the 802.11/Wireless Mode
    1. Navigate to http://mifi.admin
    2. Enter "admin" in the textbox in the upper right hand corner
    3. Click the Wi-Fi tab
    4. Change the 802.11 mode from B+G+N to B+G
    5. Click Apply
    6. Test your connection
    Remove the Wireless password
    1. Navigate to http://mifi.admin
    2. Enter "admin" in the textbox in the upper right hand corner
    3. Click the WiFi tab
    4. Change your Selected Profile to Open Access
    5. Click Apply
    6. Test your connection

  • I cleared out a movie I made in final cut pro, now fcp will not open completely, I get the logo with all the names running through but never get timeline, browser or anything else?  Help!!  Larry

    I removed a movie I had made and now when I try to open final cut pro, all the stuff shows up with the names, etc, but that is it, I don't get anything else, and, final cut does not show at the top of my computer.  I have the 27 inch iMac with the intel processor, any help will be appreciated.  Larry

    Sounds like you may have deleted more than just the movie file.  It the FCP application in the Applications folder?  if so, try launching from there.  If not, you'll neeed to uninstall the app completely using this: http://www.digitalrebellion.com/fcsremover/  then reinstall from the original install discs.
    You may want to first try trashing FCP's preferences.
    -DH

  • I recently did the latest update. My Ipad 2 would not turn on, and then the screen with the apple logo started flashing. I tried the recovery restore, but I kept getting error messages. What should I do?

    I recently did the latest update, and then I charged my Ipad 2 afterwards. I went to use my Ipad 2 days later, and it would not even turn on. Then after a couple minutes, the apple logo appeared as if it were loading. It continued to do this for a few minutes, and then the screen starting turning on and off. Then 5 minutes after that, my lock screen appeard and froze. Then it shut itself off again. I tried plugging my ipad into Itunes to do the recovery restore, but I kept getting error messages.

    Unable to Update or Restore
    http://support.apple.com/kb/HT1808

Maybe you are looking for

  • My battery barely lasts for 3 hours...

    My battery barely lasts for 3 hours and won't charge while in use & the phone heats a lot. The phone is only about 6 months old, will the battery be replaced under the apple warrenty?

  • ITunes keeps reverting ID3 tags

    I have quite a few MP3s which, no matter how many times I edit/correct their ID3 tags, revert to what they were originally. This happens any time I restart iTunes. Any idea what causes this? Is it just the nature of some MP3s, or is there something I

  • JEditorPane and copy/paste

    Hello, I've got an applet with an editable JEditorPane. I can make a copy/paste in the editor from any application outside the applet and from the applet itself. But with Word under windows, the paste method tries to insert html rendered by word and

  • Uninstall Leopard and reinstall Tiger?

    I have had too many problems wih Leopard. How can I go back tso Tiger since I don't have the Tiger CD?

  • Cinema tools  multiple crash

    i just install the cinema tools and it crashes right away it doesnt even starts