How can i deal with Exception of URI

I am learning Expression Language, in one of the examples, there is a sentence like this: <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jst1/fmt" %>.
the browser will throw an exception:
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application.
How can i do with it? Thanks!

put the standard.jar on the apllication classpath WEB-INF/lib

Similar Messages

  • How can I deal with long sql by the oo4o?

    I am using VB and oo4o to develop a sql executor which is a extention of an old system.
    For some reason, I have to use oo4o v8.1.7 to deal with Oracle Database 8i to 11g.
    But when I send a very long sql(11KB) to it I got a error in the VB enviroment.
    The Err.Description is "automention error. Started object is disconnected by the client.".
    The Err.Number is "-2147417848 ".
    The sql that I send it to the program is a simple select sql that like select a, b, c, substrb(d, 1, 2), substrb(e, 2, 3) .... from A_TBL where A=aa;
    This sql is normally executed by the sqlplus but I got an error by the oo4o.
    When I insert a '' between the 30Xth items, it got exectuted normally.
    ex. select a, b, c, substrb(d, 1, 2), substrb(e, 1, 2) ..... substrb(303th, 3, 4), '', substrb(304th, 1, 2) ... from A_TBL where A = aa;
    How can I deal with this problem? Thanks.

    So how can use this function correctly?By learning what exceptions are, how they're used, and what you can do to deal with them. There's a tutorial here: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.htmlAnd here's a quick overview:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

  • It says that "there was a problem connecting to the server". What's wrong with this, and how can I deal with this problem?

    I just got my new iPad Mini2, and when I choose "sign in with your apple ID", it says that "there was a problem connecting to the server". What's wrong with this, and how can I deal with this problem?

    1. Turn router off for 30 seconds and on again
    2. Settings>General>Reset>Reset Network Settings

  • HT5621 I have moved permanently from the US to live in the UK. when I try to download a UK app I am often told that I cannot use a UK Apple sstore, only a US store. I need to access various UK stores how can I deal with this?

    I have moved permanently from the US to live in the UK. when I try to download a UK app I am often told that I cannot use a UK Apple sstore, only a US store. I need to access various UK stores how can I deal with this?

    Try here
    http://support.apple.com/kb/HT1311
    when you have UK Cards etc best to change as well

  • Adobe always quits unexpectedly in Mac when I read a bit fast. How can i deal with it, plz?

    Adobe always quits unexpectedly in Mac when I read a bit fast.
    It is the latest update.
    How can i deal with it, plz?

    You posted in the forum for iPad and iPhone (different app). I've moved your question to the Reader forum for desktop/laptop computers.

  • How can I deal with an apostrophy

    My simple questions is how can I deal with an apostrophy when I trying to save to the table, here is an example in how I am saving.
    'Sandr'as Casa' this gives me an error message. I have to do it like this
    Strings.replace("Sandr'as Casa"," ' "," ' ' "), a package function
    SQLDesFollow = "UPDATE [CRVMReq] " +
    "SET [SkillSet]='" + Strings.replace("Sandr'as Casa"," ' "," ' ' ")+ "'" WHERE [ReqId]='" + ReqValuesReqId[4] + "";
    dbs.execute(SQLDesFollow);
    SQLDesFollow = "UPDATE [CRVMReq] " +
    "SET [SkillSet]='Sandr'as Casa' WHERE [ReqId]='" + ReqValuesReqId[4] + "";
    dbs.execute(SQLDesFollow);
    any help will be appreciated.

    Here is the magic word: PreparedStatement.
    Start here:
    http://java.sun.com/docs/books/tutorial/jdbc/basics/pr
    epared.htmlSeconded, thirded and fourthed.
    And if later readers of this thread feel that they would like to provide another answer then they should think again because they would be wrong.
    There is only one correct answer to this question. PreparedStatement.

  • TS1436 I received this message twice on 2 new & separate attempts to burn a playlist to a NEW cd:  "The attempt to burn a disc failed.  The burn failed because of a medium write error."  What is a "medium write error" and how can I deal with this?

    I received this message twice on 2 new & separate attempts to burn a playlist to a NEW cd:  "The attempt to burn a disc failed.  The burn failed because of a medium write error."  What is a "medium write error" and how can I deal with this?

    Hello Pat,
    The following article provides troublehsooting steps and information that can help get iTunes burning discs again.
    Can't burn a CD in iTunes for Windows
    http://support.apple.com/kb/TS1436
    Cheers,
    Allen

  • Hi apple am new user to apple i just bought i phone 4s  and  i set up passowrd and forgot it how  and the iphone is not responding now how can i deal with this broblem please helpe

    hi apple am new user to apple i just bought i phone 4s  and  i set up passowrd and forgot it how  and the iphone is not responding now how can i deal with this broblem please helpe

    iPhone User Guide (For iOS 5.1 Software)

  • How can I deal with the "throw exception"?

    A function has the following definition:
    import javax.naming.NamingException;
    public BinRelation readBinRelation() throws BadInputDataException,IOException
    When I use this function as follows:
    BinRelation binRel;
    binRel = readBinRelation();
    then comes the error:
    unreported exception javax.naming.NamingException; must be caught or declared to be thrown.
    So how can use this function correctly?
    Thanks

    So how can use this function correctly?By learning what exceptions are, how they're used, and what you can do to deal with them. There's a tutorial here: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.htmlAnd here's a quick overview:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

  • How can i deal with java.security.AccessControlException?

    Hi all, I need to implement JavaMail using Servlet and deploy throught J2EE deployment tool. But when i test out the servlet i will always encounter this exception thrown. How can i solve this?
    java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    This is the servlet i am testing. Please advise. Thanks in advance!
    * @(#)JavaMailServlet.java     1.3 99/12/06
    * Copyright 1998, 1999 Sun Microsystems, Inc. All Rights Reserved.
    * This software is the proprietary information of Sun Microsystems, Inc.
    * Use is subject to license terms.
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    * This is a servlet that demonstrates the use of JavaMail APIs
    * in a 3-tier application. It allows the user to login to an
    * IMAP store, list all the messages in the INBOX folder, view
    * selected messages, compose and send a message, and logout.
    * <p>
    * Please note: This is NOT an example of how to write servlets!
    * This is simply to show that JavaMail can be used in a servlet.
    * <p>
    * For more information on this servlet, see the
    * JavaMailServlet.README.txt file.
    * <p>
    * For more information on servlets, see
    * * http://java.sun.com/products/java-server/servlets/index.html
    * @author Max Spivak
    public class JavaMailServlet extends HttpServlet implements SingleThreadModel {
    String protocol = "POP3";
    String mbox = "INBOX";
    * This method handles the "POST" submission from two forms: the
    * login form and the message compose form. The login form has the
    * following parameters: <code>hostname</code>, <code>username</code>,
    * and <code>password</code>. The <code>send</code> parameter denotes
    * that the method is processing the compose form submission.
    public void doPost(HttpServletRequest req, HttpServletResponse res)
         throws ServletException, IOException {
    // get the session
         HttpSession ssn = req.getSession(true);
         String send = req.getParameter("send");
    String host = req.getParameter("hostname");
    String user = req.getParameter("username");
    String passwd = req.getParameter("password");
    URLName url = new URLName(protocol, host, -1, mbox, user, passwd);
    ServletOutputStream out = res.getOutputStream();
         res.setContentType("text/html");
         out.println("<html><body bgcolor=\"#CCCCFF\">");
         if (send != null) {
         // process message sending
         send(req, res, out, ssn);
         } else {
         // initial login
         // create
         MailUserData mud = new MailUserData(url);
         ssn.putValue("javamailservlet", mud);
         try {
              Properties props = System.getProperties();
              System.out.println("url");
              props.put("mail.smtp.host", host);
              Session session = Session.getDefaultInstance(props, null);
              session.setDebug(false);
              Store store = session.getStore(url);
              store.connect();
              Folder folder = store.getDefaultFolder();
              if (folder == null)
              throw new MessagingException("No default folder");
              folder = folder.getFolder(mbox);
              if (folder == null)
              throw new MessagingException("Invalid folder");
              folder.open(Folder.READ_WRITE);
              int totalMessages = folder.getMessageCount();
              Message[] msgs = folder.getMessages();
              FetchProfile fp = new FetchProfile();
              fp.add(FetchProfile.Item.ENVELOPE);
              folder.fetch(msgs, fp);
              // track who logged in
              System.out.println("Login from: " + store.getURLName());
              // save stuff into MUD
              mud.setSession(session);
              mud.setStore(store);
              mud.setFolder(folder);
              // splash
              out.print("<center>");
              out.print("<font face=\"Arial,Helvetica\" font size=+3>");
              out.println("<b>Welcome to JavaMail!</b></font></center><p>");
              // folder table
              out.println("<table width=\"50%\" border=0 align=center>");
              // folder name column header
              out.print("<tr><td width=\"75%\" bgcolor=\"#ffffcc\">");
              out.print("<font face=\"Arial,Helvetica\" font size=-1>");
              out.println("<b>FolderName</b></font></td><br>");
              // msg count column header
              out.print("<td width=\"25%\" bgcolor=\"#ffffcc\">");
              out.print("<font face=\"Arial,Helvetica\" font size=-1>");
              out.println("<b>Messages</b></font></td><br>");
              out.println("</tr>");
              // folder name
              out.print("<tr><td width=\"75%\" bgcolor=\"#ffffff\">");
              out.print("<a href=\"" + HttpUtils.getRequestURL(req) + "\">" +
                   "Inbox" + "</a></td><br>");
              // msg count
              out.println("<td width=\"25%\" bgcolor=\"#ffffff\">" +
                   totalMessages + "</td>");
              out.println("</tr>");
              out.println("</table");
         } catch (Exception ex) {
              out.println(ex.toString());
         } finally {
              out.println("</body></html>");
              out.close();
    * This method handles the GET requests for the client.
    public void doGet (HttpServletRequest req, HttpServletResponse res)
         throws ServletException, IOException {
    HttpSession ses = req.getSession(false); // before we write to out
    ServletOutputStream out = res.getOutputStream();
         MailUserData mud = getMUD(ses);
         if (mud == null) {
         res.setContentType("text/html");
         out.println("<html><body>Please Login (no session)</body></html>");
         out.close();
         return;
         if (!mud.getStore().isConnected()) {
         res.setContentType("text/html");
         out.println("<html><body>Not Connected To Store</body></html>");
         out.close();
         return;
         // mux that takes a GET request, based on parameters figures
         // out what it should do, and routes it to the
         // appropriate method
         // get url parameters
         String msgStr = req.getParameter("message");
    String logout = req.getParameter("logout");
         String compose = req.getParameter("compose");
         String part = req.getParameter("part");
         int msgNum = -1;
         int partNum = -1;
         // process url params
         if (msgStr != null) {
         // operate on message "msgStr"
         msgNum = Integer.parseInt(msgStr);
         if (part == null) {
              // display message "msgStr"
    res.setContentType("text/html");
              displayMessage(mud, req, out, msgNum);
         } else if (part != null) {
              // display part "part" in message "msgStr"
              partNum = Integer.parseInt(part);
    displayPart(mud, msgNum, partNum, out, res);
         } else if (compose != null) {
         // display compose form
         compose(mud, res, out);
    } else if (logout != null) {
         // process logout
    try {
    mud.getFolder().close(false);
    mud.getStore().close();
              ses.invalidate();
    out.println("<html><body>Logged out OK</body></html>");
    } catch (MessagingException mex) {
    out.println(mex.toString());
         } else {
         // display headers
         displayHeaders(mud, req, out);
    /* main method to display messages */
    private void displayMessage(MailUserData mud, HttpServletRequest req,
                        ServletOutputStream out, int msgNum)
         throws IOException {
         out.println("<html>");
    out.println("<HEAD><TITLE>JavaMail Servlet</TITLE></HEAD>");
         out.println("<BODY bgcolor=\"#ccccff\">");
         out.print("<center><font face=\"Arial,Helvetica\" ");
         out.println("font size=\"+3\"><b>");
         out.println("Message " + (msgNum+1) + " in folder " +
              mud.getStore().getURLName() +
              "/INBOX</b></font></center><p>");
         try {
         Message msg = mud.getFolder().getMessage(msgNum);
         // first, display this message's headers
         displayMessageHeaders(mud, msg, out);
         // and now, handle the content
         Object o = msg.getContent();
         //if (o instanceof String) {
         if (msg.isMimeType("text/plain")) {
              out.println("<pre>");
              out.println((String)o);
              out.println("</pre>");
         //} else if (o instanceof Multipart){
         } else if (msg.isMimeType("multipart/*")) {
              Multipart mp = (Multipart)o;
              int cnt = mp.getCount();
              for (int i = 0; i < cnt; i++) {
              displayPart(mud, msgNum, mp.getBodyPart(i), i, req, out);
         } else {
              out.println(msg.getContentType());
         } catch (MessagingException mex) {
         out.println(mex.toString());
         out.println("</BODY></html>");
         out.close();
    * This method displays a message part. <code>text/plain</code>
    * content parts are displayed inline. For all other parts,
    * a URL is generated and displayed; clicking on the URL
    * brings up the part in a separate page.
    private void displayPart(MailUserData mud, int msgNum, Part part,
                   int partNum, HttpServletRequest req,
                   ServletOutputStream out)
         throws IOException {
         if (partNum != 0)
         out.println("<p><hr>");
    try {
         String sct = part.getContentType();
         if (sct == null) {
              out.println("invalid part");
              return;
         ContentType ct = new ContentType(sct);
         if (partNum != 0)
              out.println("<b>Attachment Type:</b> " +
                   ct.getBaseType() + "<br>");
         if (ct.match("text/plain")) {
              // display text/plain inline
              out.println("<pre>");
              out.println((String)part.getContent());
              out.println("</pre>");
         } else {
              // generate a url for this part
              String s;
              if ((s = part.getFileName()) != null)
              out.println("<b>Filename:</b> " + s + "<br>");
              s = null;
              if ((s = part.getDescription()) != null)
              out.println("<b>Description:</b> " + s + "<br>");
              out.println("<a href=\"" +
                   HttpUtils.getRequestURL(req) +
                   "?message=" +
                   msgNum + "&part=" +
                   partNum + "\">Display Attachment</a>");
         } catch (MessagingException mex) {
         out.println(mex.toString());
    * This method gets the stream from for a given msg part and
    * pushes it out to the browser with the correct content type.
    * Used to display attachments and relies on the browser's
    * content handling capabilities.
    private void displayPart(MailUserData mud, int msgNum,
                   int partNum, ServletOutputStream out,
                   HttpServletResponse res)
         throws IOException {
         Part part = null;
    try {
         Message msg = mud.getFolder().getMessage(msgNum);
         Multipart mp = (Multipart)msg.getContent();
         part = mp.getBodyPart(partNum);
         String sct = part.getContentType();
         if (sct == null) {
              out.println("invalid part");
              return;
         ContentType ct = new ContentType(sct);
         res.setContentType(ct.getBaseType());
         InputStream is = part.getInputStream();
         int i;
         while ((i = is.read()) != -1)
              out.write(i);
         out.flush();
         out.close();
         } catch (MessagingException mex) {
         out.println(mex.toString());
    * This is a utility message that pretty-prints the message
    * headers for message that is being displayed.
    private void displayMessageHeaders(MailUserData mud, Message msg,
                        ServletOutputStream out)
         throws IOException {
         try {
         out.println("<b>Date:</b> " + msg.getSentDate() + "<br>");
    Address[] fr = msg.getFrom();
    if (fr != null) {
    boolean tf = true;
    out.print("<b>From:</b> ");
    for (int i = 0; i < fr.length; i++) {
    out.print(((tf) ? " " : ", ") + getDisplayAddress(fr));
    tf = false;
    out.println("<br>");
    Address[] to = msg.getRecipients(Message.RecipientType.TO);
    if (to != null) {
    boolean tf = true;
    out.print("<b>To:</b> ");
    for (int i = 0; i < to.length; i++) {
    out.print(((tf) ? " " : ", ") + getDisplayAddress(to[i]));
    tf = false;
    out.println("<br>");
    Address[] cc = msg.getRecipients(Message.RecipientType.CC);
    if (cc != null) {
    boolean cf = true;
    out.print("<b>CC:</b> ");
    for (int i = 0; i < cc.length; i++) {
    out.print(((cf) ? " " : ", ") + getDisplayAddress(cc[i]));
              cf = false;
    out.println("<br>");
         out.print("<b>Subject:</b> " +
              ((msg.getSubject() !=null) ? msg.getSubject() : "") +
              "<br>");
    } catch (MessagingException mex) {
         out.println(msg.toString());
    * This method displays the URL's for the available commands and the
    * INBOX headerlist
    private void displayHeaders(MailUserData mud,
                        HttpServletRequest req,
    ServletOutputStream out)
         throws IOException {
    SimpleDateFormat df = new SimpleDateFormat("EE M/d/yy");
    out.println("<html>");
    out.println("<HEAD><TITLE>JavaMail Servlet</TITLE></HEAD>");
         out.println("<BODY bgcolor=\"#ccccff\"><hr>");
         out.print("<center><font face=\"Arial,Helvetica\" font size=\"+3\">");
         out.println("<b>Folder " + mud.getStore().getURLName() +
              "/INBOX</b></font></center><p>");
         // URL's for the commands that are available
         out.println("<font face=\"Arial,Helvetica\" font size=\"+3\"><b>");
    out.println("<a href=\"" +
              HttpUtils.getRequestURL(req) +
              "?logout=true\">Logout</a>");
    out.println("<a href=\"" +
              HttpUtils.getRequestURL(req) +
              "?compose=true\" target=\"compose\">Compose</a>");
         out.println("</b></font>");
         out.println("<hr>");
         // List headers in a table
    out.print("<table cellpadding=1 cellspacing=1 "); // table
         out.println("width=\"100%\" border=1>"); // settings
         // sender column header
         out.println("<tr><td width=\"25%\" bgcolor=\"ffffcc\">");
         out.println("<font face=\"Arial,Helvetica\" font size=\"+1\">");
         out.println("<b>Sender</b></font></td>");
         // date column header
         out.println("<td width=\"15%\" bgcolor=\"ffffcc\">");
         out.println("<font face=\"Arial,Helvetica\" font size=\"+1\">");
         out.println("<b>Date</b></font></td>");
         // subject column header
         out.println("<td bgcolor=\"ffffcc\">");
         out.println("<font face=\"Arial,Helvetica\" font size=\"+1\">");
         out.println("<b>Subject</b></font></td></tr>");
         try {
         Folder f = mud.getFolder();
         int msgCount = f.getMessageCount();
         Message m = null;
         // for each message, show its headers
         for (int i = 1; i <= msgCount; i++) {
    m = f.getMessage(i);
              // if message has the DELETED flag set, don't display it
              if (m.isSet(Flags.Flag.DELETED))
              continue;
              // from
    out.println("<tr valigh=middle>");
    out.print("<td width=\"25%\" bgcolor=\"ffffff\">");
              out.println("<font face=\"Arial,Helvetica\">" +
                   ((m.getFrom() != null) ?
                   m.getFrom()[0].toString() :
                   "" ) +
                   "</font></td>");
              // date
    out.print("<td nowrap width=\"15%\" bgcolor=\"ffffff\">");
              out.println("<font face=\"Arial,Helvetica\">" +
    df.format((m.getSentDate()!=null) ?
                        m.getSentDate() : m.getReceivedDate()) +
                   "</font></td>");
              // subject & link
    out.print("<td bgcolor=\"ffffff\">");
              out.println("<font face=\"Arial,Helvetica\">" +
              "<a href=\"" +
                   HttpUtils.getRequestURL(req) +
    "?message=" +
    i + "\">" +
    ((m.getSubject() != null) ?
                   m.getSubject() :
                   "<i>No Subject</i>") +
    "</a>" +
    "</font></td>");
    out.println("</tr>");
         } catch (MessagingException mex) {
         out.println("<tr><td>" + mex.toString() + "</td></tr>");
         mex.printStackTrace();
         out.println("</table>");
         out.println("</BODY></html>");
         out.flush();
         out.close();
    * This method handles the request when the user hits the
    * <i>Compose</i> link. It send the compose form to the browser.
    private void compose(MailUserData mud, HttpServletResponse res,
                   ServletOutputStream out)
         throws IOException {
         res.setContentType("text/html");
         out.println(composeForm);
         out.close();
    * This method processes the send request from the compose form
    private void send(HttpServletRequest req, HttpServletResponse res,
              ServletOutputStream out, HttpSession ssn)
         throws IOException {
    String to = req.getParameter("to");
         String cc = req.getParameter("cc");
         String subj = req.getParameter("subject");
         String text = req.getParameter("text");
         try {
         MailUserData mud = getMUD(ssn);
         if (mud == null)
              throw new Exception("trying to send, but not logged in");
         Message msg = new MimeMessage(mud.getSession());
         InternetAddress[] toAddrs = null, ccAddrs = null;
         if (to != null) {
              toAddrs = InternetAddress.parse(to, false);
              msg.setRecipients(Message.RecipientType.TO, toAddrs);
         } else
              throw new MessagingException("No \"To\" address specified");
         if (cc != null) {
              ccAddrs = InternetAddress.parse(cc, false);
              msg.setRecipients(Message.RecipientType.CC, ccAddrs);
         if (subj != null)
              msg.setSubject(subj);
         URLName u = mud.getURLName();
         msg.setFrom(new InternetAddress(u.getUsername() + "@" +
                             u.getHost()));
         if (text != null)
              msg.setText(text);
         Transport.send(msg);
         out.println("<h1>Message sent successfully</h1></body></html>");
         out.close();
         } catch (Exception mex) {
         out.println("<h1>Error sending message.</h1>");
         out.println(mex.toString());
         out.println("<br></body></html>");
    // utility method; returns a string suitable for msg header display
    private String getDisplayAddress(Address a) {
    String pers = null;
    String addr = null;
    if (a instanceof InternetAddress &&
    ((pers = ((InternetAddress)a).getPersonal()) != null)) {
         addr = pers + " "+"<"+((InternetAddress)a).getAddress()+">";
    } else
    addr = a.toString();
    return addr;
    // utility method; retrieve the MailUserData
    // from the HttpSession and return it
    private MailUserData getMUD(HttpSession ses) throws IOException {
         MailUserData mud = null;
         if (ses == null) {
         return null;
         } else {
         if ((mud = (MailUserData)ses.getValue("javamailservlet")) == null){
              return null;
         return mud;
    public String getServletInfo() {
    return "A mail reader servlet";
    * This is the HTML code for the compose form. Another option would
    * have been to use a separate html page.
    private static String composeForm = "<HTML><HEAD><TITLE>JavaMail Compose</TITLE></HEAD><BODY BGCOLOR=\"#CCCCFF\"><FORM ACTION=\"/servlet/JavaMailServlet\" METHOD=\"POST\"><input type=\"hidden\" name=\"send\" value=\"send\"><P ALIGN=\"CENTER\"><B><FONT SIZE=\"4\" FACE=\"Verdana, Arial, Helvetica\">JavaMail Compose Message</FONT></B><P><TABLE BORDER=\"0\" WIDTH=\"100%\"><TR><TD WIDTH=\"16%\" HEIGHT=\"22\">     <P ALIGN=\"RIGHT\"><B><FONT FACE=\"Verdana, Arial, Helvetica\">To:</FONT></B></TD><TD WIDTH=\"84%\" HEIGHT=\"22\"><INPUT TYPE=\"TEXT\" NAME=\"to\" SIZE=\"30\"> <FONT SIZE=\"1\" FACE=\"Verdana, Arial, Helvetica\"> (separate addresses with commas)</FONT></TD></TR><TR><TD WIDTH=\"16%\"><P ALIGN=\"RIGHT\"><B><FONT FACE=\"Verdana, Arial, Helvetica\">CC:</FONT></B></TD><TD WIDTH=\"84%\"><INPUT TYPE=\"TEXT\" NAME=\"cc\" SIZE=\"30\"> <FONT SIZE=\"1\" FACE=\"Verdana, Arial, Helvetica\"> (separate addresses with commas)</FONT></TD></TR><TR><TD WIDTH=\"16%\"><P ALIGN=\"RIGHT\"><B><FONT FACE=\"Verdana, Arial, Helvetica\">Subject:</FONT></B></TD><TD WIDTH=\"84%\"><INPUT TYPE=\"TEXT\" NAME=\"subject\" SIZE=\"55\"></TD></TR><TR><TD WIDTH=\"16%\"> </TD><TD WIDTH=\"84%\"><TEXTAREA NAME=\"text\" ROWS=\"15\" COLS=\"53\"></TEXTAREA></TD></TR><TR><TD WIDTH=\"16%\" HEIGHT=\"32\"> </TD><TD WIDTH=\"84%\" HEIGHT=\"32\"><INPUT TYPE=\"SUBMIT\" NAME=\"Send\" VALUE=\"Send\"><INPUT TYPE=\"RESET\" NAME=\"Reset\" VALUE=\"Reset\"></TD></TR></TABLE></FORM></BODY></HTML>";
    * This class is used to store session data for each user's session. It
    * is stored in the HttpSession.
    class MailUserData {
    URLName url;
    Session session;
    Store store;
    Folder folder;
    public MailUserData(URLName urlname) {
         url = urlname;
    public URLName getURLName() {
         return url;
    public Session getSession() {
         return session;
    public void setSession(Session s) {
         session = s;
    public Store getStore() {
         return store;
    public void setStore(Store s) {
         store = s;
    public Folder getFolder() {
         return folder;
    public void setFolder(Folder f) {
         folder = f;

    You posted a thousand lines of badly-formatted code and didn't have the sense to say which one had the exception.
    My guess is that it was this one:Session session = Session.getDefaultInstance(props, null);because that happened to me. I fixed it by calling getInstance instead of getDefaultInstance.
    However if that isn't the problem, how about spending a few seconds to post a less useless question?

  • How can we deal with Button group

    hi,
    i was wondering how can we add a listener to the buttons in abutton group,i have a buttongroup,2 textfields for totals and button"submit" and "update".what i wanted is when i press on submit,then teh button taht was selcted in buttongroup should be taken stored and if its male add 1 to maletotal ,or femaltotaland dispalyed in teh textfileds below and when i press "update" the item taht was selected should be wriiten in a file "gen" with the totals too..for thsi purpose i w rote the code as....
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    import javax.swing.BoxLayout.*;
    import java.text.*;
    import java.util.*;
    public class gender1 extends JFrame implements ActionListener
    JPanel buttonpanel=new JPanel(),
    private JPanel mainpanel=new JPanel(new BorderLayout());
    private JButton Submit=new JButton("SUBMIT");
    private JButton Update=new JButton("Update");
    private JRadioButton gender[]=new JRadioButton[genderOptions];
    private String genderlabels[]={"female","male"};
    private JTextField malefield=new JTextField(10),
    femalefield=new JTextField(10);
    public gender1()
              this.getContentPane().setLayout(new BorderLayout());
              updatetotal();
              initGender();
    public void updatetotal()
    //adding buttons and actionlisteners
    lpanel.add(Update);
    Update.addActionListener(this);
    lpanel.add(Submit);
    Submit.addActionListener(this);
    //adding textfileds for totals
    lpanel.add(totmale);
    lpanel.add(totfemale);
    mainpanel.add(lpanel,"Center");
    public void initGender()
    buttonpanel.setBackground(Color.red.darker());
         buttonpanel.setLayout(new BoxLayout(buttonpanel,BoxLayout.X_AXIS));
         for (int k = 0;k < genderOptions;k++)
         gender[k]=new JRadioButton(genderlabels[k]);
    buttonpanel.add(gender[k]);
    optGroup1.add(gender[k]);
         mainpanel.add(buttonpanel);
         gender[0].setSelected(true);
    //get teh one button which is selected
    gender[].addActionlistener(this);
    public void actionPerformed(ActionEvent e)
    if (e.getSource==Update)
    if(gender[].getSelected()=="male")
    int mtot,ftot=0
    mtot=tot+1;
         int maletotal=maletotal+mtot;
    else
    ftot=ftot+1;
    int femaletotal=femaletotal+ftot;
    femalefield=totfemale.setText(femaletotal);
    malefield=totmale.setText(maletotal);
    if(e.getSource==submit)
    DataOutputStream dos=new DataOutputStream(FileOutputStream(gen))
    dos.writeInt(maletotal);
    dos.writeInt(femaletotal);
    public static void main(String s[])
    gender c=new gender();
    c.setSize(800,600);
    c.setVisible(true);
    c.addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent e)
    { System.exit(0);
    Is this the way to deal it?????

    I use something like this in one of my GUI's
    boolean female = false;
    add a listener to the radio buttons and toggle the flag between true and false;
    set the radio button to male as selected or female which ever is pc at the moment.
    Jim

  • How should I deal with exceptions?

    I have three possible choices that I see:
    (1) Deal with them in an exception handler class. Use try/catch/throw in the class. Have throw call a method in the exception handler class.
    (2) Use try/catch/throw and handle the exception in the same class where the exception occurs.
    (3) Use throws and deal with the exceptions in the mediator class. The mediator class allows for communication between my FileHandler class, my DBHandler class, my UIClass, and any future classes.
    Note that for each exception, I want to call a method in the UI class that displays a message to the user about the error so it can be debugged and a method in some class to write the error to an error log text file.

    Handling
    can mean as little as logging the error.I'm gonna have to go ahead and disagree with youthere, %.
    Disagree with me? This cannot be tolerated! 8)Watch it, lest yet get yer ass smote.
    Except for where you're intentionally
    smothering exceptions in finally blocks, or maybe
    just recording an InterruptedException, justlogging
    it is little better than smothering it. So what about unchecked exceptions? Are these .NET
    demon spawn?I let unchecked exceptions bubble up. I'd expect an appserver to catch and log them, so that a bug in one app doesn't cause the whole server to barf. But other than that kind of situation, these are exceptions that you usually shouldn't try to handle.
    >
    I'm curious, since this thread is so much about
    handling exceptions. What do people do besides
    report them? If you get a SQL exception, what
    recovery actions are you taking? Anything that I'm
    missing?Usually it just bubbles up, or it's a wrapped in a more appropriate or layer-specific exception and rethrown. Sometimes there might be a retry, but usually the exception bubbles up to the higher layers and gets presented to the user as something like, "Could not connect. Retry?" What I hate to see is this:
    try {
        // get stuff from the DB
    catch (SQLExeption exc) {
        // log it
    // Continue here (where "here" may be the calling method)
    // with no idea that anything went wong.If you do that, you might as well not have an exception mechanism. Just go back to return codes and don't bother checking them.

  • My speaker doesn't work, how can I deal with it?

    Hey, my speaker haven't worked for a month, and I am wondering how I can deal with it?

    Hi there sugardeer,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iPhone: Can't hear through the receiver or speakers
    http://support.apple.com/kb/TS1630
    -Griff W.

  • How can i deal with this problem

    For example, In my database, there are three records:
    field : a b c
    a.txt c:/a.txt adsfs
    b.txt c:/b.txt asdfsf
    c.txt c:/c.txt asfdsf
    Now I open one file b.txt to check the database whether have the same filename,filepath, hash value.
    the results display:
    The file: b.txt has not been registered
    The file: c://b.txt appears OK
    The file: b.txt has not been registered
    I want to do is to only shows the results of 'The file: c://b.txt appears OK'. I know the problem is the body of while(rs.next).
    is there any best way to conform to my demand
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url="jdbc:odbc:MD5";
    Connection connection=DriverManager.getConnection(url);
    Statement statement = connection.createStatement();
    String sql="SELECT * FROM MD5";
    ResultSet rs = statement.executeQuery(sql);
    while (rs.next()) {
    if (file.getName().equals(rs.getString("a")))
      if (file.getPath().equals(rs.getString("b")))
      if (m.equals(rs.getString("c")))
        jTextArea2.append("The file: " + file.getPath() +"appears OK"+"\n");
    else jTextArea2.append("The file: " + file.getPath() +"has been modified"+"\n");
    else jTextArea2.append("The Path for the" + file.getName() +"has been modified"+"\n");
    else jTextArea2.append("The file: " + file.getName() +"has not been registered"+"\n");
    rs.close();
    connection.close();
    }

    Why not add a WHERE clause to your statment to filter records having the name of the file in the first record. In this case you'd better use PreparedStatement and set the file name as statement parameter
    Because now you loop through the entire table for a thing you can deal with at DB level.
    And I agree with the others' remarks about those braces ;)
    Mike

  • How can I deal with negative marking in a quiz marking scheme?

    I wonder if anyone can help me with a problem I have in developing the 'code' for a marking scheme for an exam in Captivate 8. I would be very grateful for pointers towards a viable solution. At the moment I am just thrashing around.
    My background is in C++ and I think part of my problem is in trying to find analogues of functions I would use in that environment. My experience with Captivate is limited to developing fairly simple training courses but now I need to put an existing exam on line, maintaining its relatively complicated marking scheme, which is as follows:
    The paper is multiple choice, each question having four statements, one (or at the most two) of which is true. A completely correct answer gets 4 marks so where there are two correct statements each gets 2 marks. So far, so easy.
    The difficulty arises from an element of negative marking. If 3 or more statements are selected, the score is 0 marks. If there is a single correct statement and it and an incorrect statement are selected, the score is 2 marks. If there are 2 correct statements and one of them is selected, the score is 2 marks. If an incorrect statement is selected as well, the score is 1 mark.
    I had assumed I could use conditional logic and user variables on a slide-by-slide basis to provide a score value and then assign it to the appropriate system quiz variable, but it seems I can't assign values to variables in a quiz slide. That would have been too easy...
    So, can anybody advise me on an approach that keeps the advantages of using the quiz framework, including the use of the Review function?
    Any help very gratefully received.

    If you use SCORM 1.2 for reporting, negative scores will be converted to zero, because it doesn't allow negative score.
    If you want to keep to Review functionality, you need to stay with the default question slides. There are some tweaking possibilities but changing the score is not one of them.
    Question Question Slides in Captivate - Captivate blog
    Question Question Slides - Part 2 - Captivate blog
    I think the only possible way is to use JS, but then you'll not be able to keep the functionality of the Question slides, you are in custom question slides. Plenty of examples of custom questions can be found on my blog as well.

Maybe you are looking for

  • Multiple paintCell calls

    Hi! I have a performance problem in an application using a large JTable. During debugging I noticed that paintCell() for each field of the table is called multiple times, and that each row is repainted as a whole even though only one cell has changed

  • Can .gz files affect iPhones?

    A few weeks ago, my computer downloaded a file named "controller.gz" out of no where! When that happened, only 4 web sites were opened on my browser, including Facebook. I haven't been using these sites on my iPhone (I actually never visited them on

  • How to find grey exclamation mark pics?

    Hi gang, I have noticed when going back over some old pics that some have the thumbnail, but when I hit space to view the photo close up, I get a grey exclamation mark.  When using Reveal in Finder, the original pic file is present and looks fine.  T

  • Unibrain's "Fire-i" FW video cam for Macs without built-in iSight

    I now have a MacBook and an Intel Core Duo iMac with built-in iSight, but my wife has a G5 iMac, and has no video for using either iChat or Skype to visit with far-flung relatives. I just received delivery of a Unibrain "Fire-i" Firewire Digital Came

  • Re: Query Problem

    Hi, My DDL is: Create Table myTable (L1 Char(2),L2 Char(2),L3 Char(2),L4 Char(2),Amt Number(3)); Insert into myTable values('01','01','01','01',200); Insert into myTable values('01','02','01','01',300); Commit; Now, when I want following Query to ret