MultipartFormDataRequest

what is MultipartFormDataRequest. where can i get the zip file of the class.. I tried a lot in the google. i did't get any .zip file for this.. it's urgent pls help me out.
Regards
Ashok Kumar

Only one I know is in the uploadbean.jar that can be downloaded for for free here.
http://www.javazoom.net/index.shtml

Similar Messages

  • HTML multipart form is not working in jsp page

    Hi
    i have jsp page, has a HTML from with file upload field , when i click the send button , nothing happened as if the button did not submit the form. ie the message at line 12 is not printed out.
    can any one help please.
    <%@ page errorPage="..\error\error.jsp" %>
    <%@ page pageEncoding="windows-1256" %>
    <%@ page language="java" import="javazoom.upload.*,java.util.*,java.sql.ResultSet" %>
    <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
      <jsp:setProperty name="upBean" property="folderstore" value="<%=request.getRealPath("thuraya//uploads")%>"  />
    </jsp:useBean>
    <jsp:useBean id="dbc" class="mypackage.DBConnection" scope="session" />
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.println("addbtn");
            //do upload file + insert in database
             if (MultipartFormDataRequest.isMultipartFormData(request))
             // Uses MultipartFormDataRequest to parse the HTTP request.
             MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
             String todo = null;
             if (mrequest != null) todo = mrequest.getParameter("todo");
                 if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
                    Hashtable files = mrequest.getFiles();
                    if ( (files != null) && (!files.isEmpty()) )
                        UploadFile file = (UploadFile) files.get("filename");
                        if (file != null)
                                            out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
                                            String fileName=file.getFileName();
                                            String ran=System.currentTimeMillis()+"";
                                            String ext=fileName.substring(   ( fileName.length()-4),fileName.length() );
                                            file.setFileName(ran+ext);
                        // Uses the bean now to store specified by jsp:setProperty at the top.
                        upBean.store(mrequest, "filename");
                                            String title=request.getParameter("title");
                                            String content=request.getParameter("elm1");
                                            int x=dbc.addNews(title,content,file.getFileName(),2,1);
                                            if(x==1)
                                                     out.print("New Vedio has been addedd Successfully");
                                                      response.setHeader("Refresh","1;URL=uploadVedio.jsp");
                                                     else{
                                                      out.print("An Error Occured while adding new Vedio");
                                                      response.setHeader("Refresh","1;URL=uploadVedio.jsp");
                    else
                      out.println("<li>No uploaded files");
             else out.println("<BR> todo="+todo);
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input onClick="submit()" name="addBTN" type="button" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

    the problem is not because of java code insdie jsp page
    I have removed all things but the form and it is still not working
    here is the modified code:
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.print("addBTN");
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input name="addBTN" type="submit" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

  • Uploading a file in a jsp page

    Hii Javaites
    I am developing an application in which i need to upload file from a jsp page, right now i am using tomcat can anyone tell me the code for uploading a file.
    Thanking in Advance

    Hi,
    For uploading file from jsp:
    1) Goto javazoom.com, then download latest version for upload the files.
    2) Extract the zip & thay giving four jar files
    they are:
    i)uploadbean.jar
    ii)struts.jar
    iii)fileupload.jar
    iv)cos.jar
    put all this jar in lib of u r web application
    ex:
    C:\jakarta-tomcat-5.0.25\webapps\URWEBAPP\WEB-INF\lib\
    3) Set it in class path
    4) create one jsp with file option<input type='file' name = 'somename'>
    5) In action page(next page)
    <%@ page language="java" import="javazoom.upload.*,java.util.*" %>
    <%@ page errorPage="error.jsp" %>
    <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
    <jsp:setProperty name="upBean" property="folderstore" value="c:/uploads" />
    </jsp:useBean>
    Set the folder where u want upload the particular file.
    MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
    Hashtable files = mrequest.getFiles();
         UploadFile file = (UploadFile) files.get("somename");//Give name u r given in the previous page.
         String fileName = file.getFileName();     
    upBean.store(mrequest, "userFile");
    follow this steps it works fine.
    regards
    DRA

  • File upoad proiblem in servlet...... Unexpected end of part exception

    Hi Friends,
    I am developing a small web application using jsp, spring, and tomcat 5.0. In my application i need to to up-load one file at add page. it also contains some form fields. In servlet i am using the multipartformdatarequest. its work fine when i am running it locally. but it gives exception when it runs on the main server on uploading.
    code i used for parsing the MultiPartFormDataRequest is :
    public ModelandView addFile(HttpServletRequest request,HttpServletReqponse response)
          MultipartFormDataRequest mrequest = null;
         if(MultipartFormDataRequest.isMultipartFormData(request))
                try
                         mrequest = new MultipartFormDataRequest(request);
                 catch(Exception e){
                          e.printstacktrace();
    }the code inside the try block generates an exception. so i m not able to get the mrequest object for further operation. This code sometime work fine. but most time it fails.
    the exception stack trace is :
    java.io.IOException: unexpected end of part
    at com.oreilly.servlet.multipart.PartInputStream.fill(PartInputStream.java:96)
    at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:179)
    at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:152)
    at com.oreilly.servlet.multipart.ParamPart.<init>(ParamPart.java:49)
    at
    com.oreilly.servlet.multipart.MultipartParser.readNextPart(MultipartParser.java:280)
    at javazoom.upload.parsing.CosMultipartParser.handleRequest(Unknown Source)
    at javazoom.upload.MultipartFormDataRequest.<init>(Unknown Source)
    at javazoom.upload.MultipartFormDataRequest.<init>(Unknown Source)
    at
    com.jkt.intranet.rms.controller.ResumeController.setPersonalDetails(ResumeController.java:176)
    at
    com.jkt.intranet.rms.controller.ResumeController.addResume(ResumeController.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:351)
    at
    org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:305)
    at
    org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
    at
    org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
    at
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
    at
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
    at
    org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:355)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:768)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
    at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)Please reply as soon as possible.....
    Urgently need....

    O'Reilly's Multipart thing is dead since 2005. To exclude it from being suspect, consider using [Apache Commons FileUpload|http://commons.apache.org/fileupload] which is still in active development and is rock solid. There's excellent documentation, examples and FAQ available at the homepage behind the 'User Guide' and 'Frequently Asked Questions' links. If this gives roughly the same problem, then the cause may lie in your environment. Good luck.

  • Get filename from uploaded file then place in input tags

    i have an upload feature with the use of upBean and i can get the filname thru filename=file.getFileName
    when i place in the input tags it takes an error what i suppose to do
    <input type="hidden" name="getfilename" value="<%=filename%>">
    if (MultipartFormDataRequest.isMultipartFormData(request)) {
                            // Uses MultipartFormDataRequest to parse the HTTP request.
                            MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
                            String todo = null;
                            String filename=null;
                            String description=request.getParameter("txtDesc");
                            String checkfilename=mrequest.getParameter("uploadfile");
                            if (mrequest != null) todo = mrequest.getParameter("todo");
                            if ( (todo != null) && (todo.equalsIgnoreCase("upload")) ) {
                                Hashtable files = mrequest.getFiles();
                                if ( (files != null) && (!files.isEmpty()) && (description!=null)) {
                                    UploadFile file = (UploadFile) files.get("uploadfile");
                                    if (file != null){
                                        filename=file.getFileName();                                    if(checkfilename==null){
                                            filename="";
                                  upBean.store(mrequest, "uploadfile");  // Uses the bean now to store specified by jsp:setProperty at the top.
                                             else out.println("<BR> todo="+todo);
                    %>
                    Message was edited by:
    BlingBling15

    Thanks for reply.
    I replaced messageFileUpload (binded to blob table column) with messageStyledText (binded to filename attribute). Above the table placed single messageFileUpload and submitButton nearby. After user select file on submit I do:
    *if (pageContext.getParameter("DoUploadButton") != null) {*
    .. DataObject fileUploadData = pageContext.getNamedDataObject("FileData");
    .. *if (fileUploadData != null) {*
    .... String fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
    .... String contentType = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
    .... BlobDomain fileContent = (BlobDomain)fileUploadData.selectValue(null, fileName);
    .... String seqNumber = pageContext.getParameter("seqNumber");
    .... am.insertInstanceAttachRowBlob(seqNumber, fileName, fileContent, contentType);
    .... pageContext.removeNamedDataObject("FileData");
    .. return;
    Edited by: user12086842 on 02.01.2013 2:41

  • JSP that converts office extensions to pdf and then upload them

    Hi there !
    Im trying to convert office extensions ( .xls, .ppt, etc) to pdf and then upload the resulting file to a server .
    currectly im using the upload solution posted by the user anna_DRA here : http://forums.sun.com/thread.jspa?threadID=672874
    and as for the conversion im using a solution which uses OpenOffice's lib to do the conversion.I'm going to post the codes of my JSP and my HTML ( which just contains the form to get the file to be converted and uploaded).
    observation: the point which is giving me headaches is how to get the file sent by my form, convert it into a File object, use my conversion tool and then deliver it to my upload tool so it can be stored.... i cant seem to get the File object from the request object ( tried getattribute and it returns null....) .
    observation':I do know about and how to use MVC but my boss asked me to make this work with just one JSP or a JSP and a HTML.
    index.html :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Upload test</title>
    </head>
    <body>
    <form enctype="multipart/form-data" action="/WSPdfConversion1.1/Conversion.jsp" method=POST>
    <input type="file" name = "FileUp">
    <input type="submit" value="Enviar"/>
    </form>
    </body>
    </html>Conversion.jsp :
    upload portion:
    MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
    OpenOfficeConnection OpenOfficeConnection = new SocketOpenOfficeConnection(8100);
    String newName = "";
    Hashtable files = mrequest.getFiles();
    UploadFile file = (UploadFile) files.get("FileUp");//Give name u r given in the previous page.
    String fileName = file.getFileName();
    upBean.store(mrequest, "FileUp");conversion portion:
    OpenOfficeConnection OpenOfficeConnection = new SocketOpenOfficeConnection(8100);
    try {
        OpenOfficeConnection.connect();
    } catch (ConnectException e) {
        e.printStackTrace();
    File inputFile = new File("C:\\Users\\thiago\\Documents\\"+fileName);
    for(int i = 0; i <= fileName.length() - 4; i++){
        String s = ""+fileName.charAt(i);
        newName = newName.concat(s);
    File outputFile = new File("C:\\Users\\thiago\\Documents\\"+newName+".pdf");
    //convert the spreadsheet
    DocumentConverter ExcelToPDFConverter = new OpenOfficeDocumentConverter(OpenOfficeConnection);
    ExcelToPDFConverter.convert(inputFile, outputFile);
    OpenOfficeConnection.disconnect();Both work just ok when separated but i cant get both to work together....
    Any help is much appreciated!!!
    Thanks in advance
    Edited by: thiagocbalducci on Mar 24, 2010 12:07 PM
    Edited by: thiagocbalducci on Mar 24, 2010 12:09 PM

    Hello TSN,
    Test Screen Name wrote:
    Picking just one point: PDF -> EPS -> PDF. This could not possibly do more than one page, because EPS is absolutely by definition a single page format. Therefore you must choose a page when exporting PDF to EPS.
    Thanks for your response.
    I was thinking Microsoft... which has allowed multi-page eps files for years. But you're correct, this is normally an unsupported .eps format.
    I solved the problem over the weekend by doing the following:
    1) I removed the suspect OTF font family but despite doing so, the folder still had two 'corrupted' but unused copies of an italic font. They refused to remove so I had to boot into Win7 SAFE mode to remove.
    2) After complete removal of the OTF font family. I reinstalled the OTF font *BUT* only from a different repository (oddly, this other OTF font set is slightly larger per font).
    3) Once installed, I tested with Flare, published and uploaded to Crocodoc SUCCESSFULLY. Yeah!
    I don't have anymore time to test but the questions remain, such as, was it one or more of the following issues:
    a) Flare has a problem handling some OTF fonts or cannot error correct (the way other programs do) for marginal fonts or font errors?
    b) Was it the two corrupted fonts in the Windows/fonts folder?
    c) Was it the slightly different OTF fonts that I am no longer using?
    Take care

  • Parameter passing from jsp to jsp

    i have a jsp(mother page) there is a link when i click from my mother page a pop-up window appear now what i want is to get the value from my pop-up window (textarea, inputs, etc.) to my mother page.
    thanx a lot

    mother page(calendar.jsp)
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page session="true" import="java.util.*" %>
    <%@page import="java.io.*"%>
    <style type="text/css">
        body{
        font-family: tahoma;
        font-size: 12pt;
        a {text-decoration: none}
        a:hover { font-family: Tahoma; font-size: 12pt; color:#ff0000; text-decoration: none }
    </style>
    <%
        // Global Vars
        int action = 0;  // incoming request for moving calendar up(1) down(0) for month
        int currYear = 0; // if it is not retrieved from incoming URL (month=) then it is set to current year
        int currMonth = 0; // same as year
        String boxSize = "50";  // how big to make the box for the calendar
        //build 2 calendars
        Calendar c = Calendar.getInstance();
        Calendar cal = Calendar.getInstance();
        if (request.getParameter("action") == null) // Check to see if we should set the year and month to the current
            currMonth = c.get(c.MONTH);
            currYear = c.get(c.YEAR);
            cal.set(currYear, currMonth,1);
        else {
            if (!(request.getParameter("action") == null)) // Hove the calendar up or down in this if block
                currMonth = Integer.parseInt(request.getParameter("month"));
                currYear = Integer.parseInt(request.getParameter("year"));
                if (Integer.parseInt( request.getParameter("action")) == 1 ) {
                    cal.set(currYear, currMonth, 1);
                    cal.add(cal.MONTH, 1);
                    currMonth = cal.get(cal.MONTH);
                    currYear = cal.get(cal.YEAR);
                } else {
                    cal.set(currYear, currMonth ,1);
                    cal.add(cal.MONTH, -1);
                    currMonth = cal.get(cal.MONTH);
                    currYear = cal.get(cal.YEAR);
    %>
        <%!
            public boolean isDate(int m, int d, int y) // This method is used to check for a VALID date
                m -= 1;
                Calendar c = Calendar.getInstance();
                c.setLenient(false);
                try {
                    c.set(y,m,d);
                    Date dt = c.getTime();
                } catch (IllegalArgumentException e) {
                    return false;
                return true;
        %>
                <%!
                    public String getDateName(int monthNumber) // This method is used to quickly return the proper name of a month
                        String strReturn = "";
                        switch (monthNumber) {
                            case 0:
                                strReturn = "January";
                                break;
                            case 1:
                                strReturn = "February";
                                break;
                            case 2:
                                strReturn = "March";
                                break;
                            case 3:
                                strReturn = "April";
                                break;
                            case 4:
                                strReturn = "May";
                                break;
                            case 5:
                                strReturn = "June";
                                break;
                            case 6:
                                strReturn = "July";
                                break;
                            case 7:
                                strReturn = "August";
                                break;
                            case 8:
                                strReturn = "September";
                                break;
                            case 9:
                                strReturn = "October";
                                break;
                            case 10:
                                strReturn = "November";
                                break;
                            case 11:
                                strReturn = "December";
                                break;
                        return strReturn;
                %>
                <script>
                    function doLoad()
                    setTimeout( "refresh()", 2*1000 );
                </script>
                        <html>
                            <form name="upform" method="post">
                                <body bgcolor='white'>
                                    <table border="0" width="520" bordercolorlight="#C0C0C0" bordercolordark="#808080" style="border-collapse: collapse" bordercolor="#111111">
                                        <td>                   
                                            <table border='1' height="20" width='520' celpadding='3' cellspacing='0'>
                                                <tr>
                                                    <td width='120' align='center' valign='middle' height="40"><a href="calendar.jsp?month=<%=currMonth%>&year=<%=currYear%>&action=0"><font size="2"><< Previous Month</font></a></td>
                                                    <td width='280' align='center' valign='middle' height="40" style="font-family: tahoma; font-size: 14pt; color:#800000 "><b><%=getDateName (cal.get(cal.MONTH)) + " " + cal.get(cal.YEAR)%></b></td>
                                                    <td width='120' align='center' valign='middle' height="40"><a href="calendar.jsp?month=<%=currMonth%>&year=<%=currYear%>&action=1"><font size="2">Next Month >></font></a></td>
                                                </tr>
                                            </table>
                                            <table border="0" width="520" bordercolorlight="#C0C0C0" bordercolordark="#808080" style="border-collapse: collapse" bordercolor="#111111">
                                                <td width="100%">
                                                    <table border="2" width="520" bordercolorlight="#C0C0C0" bordercolordark="#000000" style="border-collapse: collapse" bordercolor="#000000"  bgcolor="#DFDCD8">
                                                        <tr style="background-color: #B22222">
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Sun</b></font></td>
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Mon</b></font></td>
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Tue</b></font></td>
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Wed</b></font></td>
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Thu</b></font></td>
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Fri</b></font></td>
                                                            <td width="<%=boxSize%>" align="center" nowrap bordercolor="#666666">
                                                            <font color="#FFFFFF"><b>Sat</b></font></td>
                                                        </tr>
                                                        <%
                                                            //'Calendar loop
                                                            int currDay;
                                                            String todayColor;
                                                            int count = 1;
                                                            int dispDay = 1;
                                                            for (int w = 1; w < 7; w++) {
                                                        %>
                                                        <tr>
                                                            <%
                                                                for (int d = 1; d < 8; d++) {
                                                                    if (! (count >= cal.get(c.DAY_OF_WEEK))) {
                                                            %>
                                                            <td width="<%=boxSize%>" height="<%=boxSize%>" valign="top" align="left"> </td>
                                                            <%
                                                                count += 1;
                                                                } else {
                                                                    if (isDate( currMonth + 1, dispDay, currYear) ) // use the isDate method
                                                                        if ( dispDay == c.get(c.DAY_OF_MONTH) && c.get(c.MONTH) == cal.get(cal.MONTH) && c.get(c.YEAR) == cal.get(cal.YEAR)) // Here we check to see if the current day is today
                                                                            todayColor = "#A52A2A";
                                                                        } else {
                                                                            todayColor = "#ffffff";
                                                            %>
                                                            <td bgcolor ="<%=todayColor%>" width="<%=boxSize%>" align="left" height="<%=boxSize%>" valign="top"><%=dispDay%><br>
                                                            </td>
                                                            <%
                                                                count += 1;
                                                                dispDay += 1;
                                                                        } else {
                                                            %>
                                                            <td width="<%=boxSize%>" align="left" height="<%=boxSize%>" valign="top"> </td>
                                                            <%
                                                            %>
                                                        </tr>
                                                        <%
                                                        %>
                                                    </table>
                                                </td>
                                            </table>
                                        </td>
                                    </table>
                                    <input type="text" name="selMonth" value="">
                                    <input type="text" name="selDay" value="">
                                    <input type="text" name="selYear" value="">
                                    <input type="text" name="txtDesc" value="">
                                    <%
                                        String month=request.getParameter("selMonth");
                                        String day=request.getParameter("selDay");
                                        String year=request.getParameter("selYear");
                                        String desc=request.getParameter("txtDesc");
                                        out.println(month);
                                        out.println(day);
                                        out.println(year);
                                        out.println(desc);
                                    %>
                                    <br>
                                    <a href="addevents.jsp" target="popup" onClick="wopen('addevents.jsp', 'popup', 390, 130); return false;">  ADD EVENTS</a>
                                </body>
                            </form>
                        </html>
    <script>
        function wopen(url, name, w, h)
        w += 32;
        h += 96;
        var win = window.open(url,
        name,
        'width=' + w + ', height=' + h + ', ' +
        'location=no, menubar=no, ' +
        'status=no, toolbar=no, scrollbars=no, resizable=no');
        win.resizeTo(w, h);
        win.focus();
    </script> popupwindow(addevents.jsp)
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>  <%@ page language="java" import="javazoom.upload.*,java.util.*" %>
        <%@ page errorPage="ExceptionHandler.jsp" %>
        <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
            <jsp:setProperty name="upBean" property="folderstore" value="C:\ffwApplication\uploadbean\web\uploads"/>
            <jsp:setProperty name="upBean" property="overwrite" value="true" />
        </jsp:useBean>
    <style type="text/css">
        body {color:#ff0000 ;
        margin-left: 0px;
        margin-right: 0px;
        margin-top: 0px;
        margin-bottom: 0px;
        td{font-family: Tahoma;
        font-size: 9pt;
        color: #B22222;
        h4{font-family: Arial, Helvetica, sans-serif;
        font-size: 12pt;
        color: #800000;
        a {text-decoration: none}
        a:hover { font-family: Tahoma; font-size: 11pt; color:#ff0000; text-decoration: none }
    </style>
    <script type="text/javascript">
        function returninput(){
          var form = document.upform;
          var release = true;
            if (upform.txtDesc.value == "")
               alert('Please input description for reference.');
                release = false;
                if (release)
                  var checkform = window.opener.document.upform;
                  checkform.selMonth.value = form.selMonth.value;
                  checkform.selDay.value = form.selDay.value;
                  checkform.selYear.value = form.selYear.value;
                  checkform.txtDesc.value = form.txtDesc.value;
                  //window.close();
    </script>
    <html>
        <head>
            <title></title>
        </head>
        <body>
            <form method="post" action="addevents.jsp" name="upform" enctype="multipart/form-data" onsubmit="javascript:returninput()">
                <table>
                    <tr>
                        <td align="center" colspan="4"><h4>Add Events<h4></td>
                    </tr>
                    <tr>
                        <td align="right">Select Date</td>
                        <td>
                            <select id="selMonth" name="selMonth">
                                <option value="January">January</option>
                                <option value="February">February</option>
                                <option value="March">March</option>
                                <option value="April">April</option>
                                <option value="May">May</option>
                                <option value="June">June</option>
                                <option value="July">July</option>
                                <option value="August">August</option>
                                <option value="September">September</option>
                                <option value="October">October</option>
                                <option value="November">November</option>
                                <option value="December">December</option>
                            </select> / 
                            <select name="selDay" id="selDay">
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                                <option value="13">13</option>
                                <option value="14">14</option>
                                <option value="15">15</option>
                                <option value="16">16</option>
                                <option value="17">17</option>
                                <option value="18">18</option>
                                <option value="19">19</option>
                                <option value="20">20</option>
                                <option value="21">21</option>
                                <option value="22">22</option>
                                <option value="23">23</option>
                                <option value="24">24</option>
                                <option value="25">25</option>
                                <option value="26">26</option>
                                <option value="27">27</option>
                                <option value="28">28</option>
                                <option value="29">29</option>
                                <option value="30">30</option>
                                <option value="31">31</option>
                            </select> /  
                            <select name="selYear" id="selYear">
                                <option value="2000">2000</option>
                                <option value="2001">2001</option>
                                <option value="2002">2002</option>
                                <option value="2003">2003</option>
                                <option value="2004">2004</option>
                                <option value="2005">2005</option>
                                <option value="2006">2006</option>
                                <option value="2007" selected>2007</option>
                                <option value="2008">2008</option>
                                <option value="2009">2009</option>
                                <option value="2010">2010</option>
                                <option value="2011">2011</option>
                                <option value="2012">2012</option>
                                <option value="2013">2013</option>
                                <option value="2014">2014</option>
                                <option value="2015">2015</option>
                                <option value="2016">2016</option>
                                <option value="2017">2017</option>
                                <option value="2018">2018</option>
                                <option value="2019">2019</option>
                                <option value="2020">2020</option>
                                <option value="2021">2021</option>
                                <option value="2022">2022</option>
                                <option value="2023">2023</option>
                                <option value="2024">2024</option>
                                <option value="2025">2025</option>
                            </select> 
                        </td>
                    </tr>
                    <tr>
                        <td align="right">Description</td>
                        <td><textarea name="txtDesc" rows="2" cols="35"></textarea></td>
                    </tr>
                    <tr>
                        <td align="right">File Upload</td><td><input type="file" name="uploadfile" size="35"></td>
                    </tr>
                    <tr>
                        <td align="center" colspan="3">
                            <br>
                            <input type="hidden" name="todo" value="upload">
                           <!--input type="button" name="Submit" value="Upload" onclick="javascript:returninput()"-->
                           <input type="submit" name="Submit" value="Upload">
                            <input type="reset" name="Reset" value="Cancel" onclick="window.close()">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <%
                                if (MultipartFormDataRequest.isMultipartFormData(request)) {
                                    // Uses MultipartFormDataRequest to parse the HTTP request.
                                    MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
                                    String todo = null;
                                    if (mrequest != null) todo = mrequest.getParameter("todo");
                                    if ( (todo != null) && (todo.equalsIgnoreCase("upload")) ) {
                                        Hashtable files = mrequest.getFiles();
                                        if ( (files != null) && (!files.isEmpty()) ) {
                                            UploadFile file = (UploadFile) files.get("uploadfile");
                                            //if (file != null) out.println("<li>Form fields : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
                                            // Uses the bean now to store specified by jsp:setProperty at the top.
                                            upBean.store(mrequest, "uploadfile");
                                        } else {
                                            out.println("<li>No uploaded files");
                                    /*    if (mrequest != null) {
                                            month=mrequest.getParameter("selMonth");
                                            day= mrequest.getParameter("selDay");
                                            year=mrequest.getParameter("selYear");
                                            desc=mrequest.getParameter("txtDesc");
                                            out.println(month);
                                            out.println(day);
                                            out.println(year);
                                            out.println(desc);
                                    } else out.println("<BR> todo="+todo);
                            %>
                        </td>
                    </tr>
                </table>
            </form>
        </body>
    </html>
                            Project description:
    If user wants to add events he/she click the add events link from my calendar.jsp then a pop-up window appear which is addevents.jsp then select date, description and offcourse he/she can upload file store in a certain directory from that info it will return to my calendar.jsp to parse the date to my calendar and create a link through the description towards my uploaded data in a certain directory
    thanx a lot...

  • Problem while uploading the file page is not forwarding

    Hi,
    Please tell me the solution for this.
    I'm uploading the file, i'm getting the values very thing, but the page is not forwarding what happening i don't no.
    Here is the code.
    <HTML>
    <%@ page language="java" import="javazoom.upload.*,java.util.*" %>
    <%@ page errorPage="ExceptionHandler.jsp" %>
    <HEAD>
    <BODY style="font:'Bookman Old Style' size="3"">
    <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
    </jsp:useBean>
    <%
    // Uploading file code
    if (MultipartFormDataRequest.isMultipartFormData(request))
    // Uses MultipartFormDataRequest to parse the HTTP request.
         MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
    String todo = null;
         if (mrequest != null) todo = mrequest.getParameter("todo");
         if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
                        Hashtable files = mrequest.getFiles();
         UploadFile file = (UploadFile) files.get("uploadfile");
              if ((file != null) && (file.getFileSize() <= 82000))
                        {System.out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
                    // Uses the bean now to store specified by jsp:setProperty at the top.
                        upBean.store(mrequest, "uploadfile");
                        else
                        System.out.println("Not Uploaded");
    if (mrequest != null)
         String Schoolname= mrequest.getParameter("schoolname");
         session.setAttribute("saSchoolname", Schoolname);
    System.out.println("Schoolname     "+Schoolname);
    %>
                        <jsp:forward page="FileTransfer.jsp"/>
    <%     
         else out.println("<BR> todo="+todo);
    //System.out.println(session.getAttribute("saswrite"));
    String amessage = request.getParameter("passmsg");
    %>
    <form name='subregiform' method="POST" onsubmit='return checkForm()' action ="FileSubmit2.jsp" ENCTYPE="multipart/form-data">
    <table width="491" border="0" cellpadding="2" >
    <tr>
    <td width="171" align="right"><br> S.S.C  :</td>
    <td width="103" align="center">Institution Name
         <input type="text" name="schoolname" size = 12 maxlength = 35 value = <%
              if(session.getAttribute("saSchoolname")!= null){%>
         <%=session.getAttribute("saSchoolname")%><%}%>>     </td>
    <tr><td width="165"><div align="right">Upload Resume :<br> <br> <br></div></td>
    <td width="356"><input type="file" name="uploadfile" size = 20>
    <font size=1><br>    <I>(Only .doc,.rtf,.txt,.html)</I></font><BR>
       <% if (amessage !=null){ %><FONT SIZE="" COLOR="RED"><strong><%= amessage %></strong></FONT><% }%> </td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="center">
         <input type="hidden" name="todo" value="upload">
    <input type="submit" name="Submit" value="Submit">
         </p>
    </td>
    </tr>
    </table>
    </form>
    </BODY>
    </HTML>

    This code is a mess! Don't put your logic and control into your JSP; use the JSP only for display!
    As for your error, it's because you can't forward after the response has been committed. An illegal state exception will be thrown except you can't see it in the browser because the server has already committed the response and can't change it now. You need to get rid of the forward action. Put in a link to that page instead. Or use a a meta tag to redirect.
    But really, this code cannot be modified to get rid of the problem. It should be scrapped and you should rethink your design. Have a servlet do your control and all this uploading code should also be put into a servlet; never in a JSP
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    Edited by: nogoodatcoding on Oct 5, 2007 2:56 PM

Maybe you are looking for

  • DOUBLE_CLICK and MOUSE_DOWN on Button

    I am trying to utilize DOUBLE_CLICK and MOUSE_DOWN for Button control. But they both are not working together. Whenever I activate MOUSE_DOWN event it simply disables DOUBLE_CLICK Code: // _btn is my Button object _btn.doubleClickEnabled = true; _btn

  • Serial number not working

    Hi all, I am trying to install Design Standard CS4 on my new laptop. I have an Adobe CS4 folder on my desktop, opened the Illustrator folder, opened Adobe CS4 and double clicked on setup Application (2,942kb) It goes through testing the system (and g

  • Indesign CS3 & Epson r2400 not printing tabloid paper

    Indesign CS3 & Epson r2400 not printing tabloid paper. MAC OS 10.5.6. Have tried all configurations of page set up 11 x17 and 8.5 x 11 spreads, custom page sizes and default paper set up. The print comes out cut off. Epson says it's an Indd problem.

  • Using bluetooth to connect iPad to cable-connected macbook...

    Does anyone know if it's possible to use bluetooth to connect an ipad wirelessly to the internet from the cable broadband connection on a macbook pro? its for my son who can't seem to use a wifi router in his student res...cheers, dean

  • Disable First Row in property loader

    Hi, TestStand 2.0.1f1 I am trying to use the property loader with the option 'First Row of Data Specifies Step Property for Each Column' unchecked. I have followed the example text as outline in the User manual Ch8 page69. But it seems that the step