rishabhsharma's Profile User Rating: -----

Reputation: 10 Tradesman
Group:
Contributor w/DIC++
Active Posts:
342 (0.17 per day)
Joined:
26-March 09
Profile Views:
7,130
Last Active:
User is offline Jun 07 2014 10:49 AM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
500

Latest Visitors

Icon   rishabhsharma has not set their status

Posts I've Made

  1. In Topic: Vertical Side Bar or Slide Out Menu or Off-Canvas Menu

    Posted 4 Mar 2014

    Ok I've made something, and it is sliding to the right, but I want that user could select menu-item from it, it should stop there, unless the cursor is off......what else I've to do....

    <html>
    	<head>
    		<title>Slidebar</title>
    		<style>
    			body { padding:0px; margin:0px;}
    			@keyframes myfirst
    			{
    			from {margin-left: 0%;}
    			to {margin-left:20%;}
    			}
    			
    			@-webkit-keyframes myfirst /* Safari and Chrome */
    			{
    			from {margin-left: 0%;}
    			to {margin-left:20%;}
    			}
    			.slidebar
    				{
    					width:20%;
    					height:100%;
    					background:#CCCCCC;
    				}
    			.slidebar:hover
    				{
    					-webkit-animation:myfirst 5s;
    					animation:myfirst 5s;
    				}
    	</style>
    	</head>
    	<body>
    		<div class="slidebar">
    		</div>
    	</body>
    </html>
    
    
  2. In Topic: Cannot Transfer File Using Ajax

    Posted 19 Feb 2014

    Thank you blackcompe.....
  3. In Topic: Cannot Transfer File Using Ajax

    Posted 18 Feb 2014

    I even made a short code for myself, but :
    List a = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); 
    
    

    always returns 0. I don't know what's the reason behind it. I have tried all possible activities I could but for no result. Please help me out. I tried to access .txt, .xsl, .xslx, .jpg file but result is always 0. Why is that so?

    package com.example.ams;
    
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.FileItemFactory;
    import org.apache.commons.io.*;
    import org.apache.poi.ss.usermodel.Cell;
    import org.apache.poi.ss.usermodel.Row;
    import org.apache.poi.xssf.usermodel.XSSFSheet;
    import org.apache.poi.xssf.usermodel.XSSFWorkbook;
    
    public class UploadFile extends HttpServlet
    	{
    		Connection con ;
    		Statement stat ;
    		PrintWriter out ;
    		static int nos = 0 ;
    		String msg = "";
    		public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException
    			{
    				doPost(request,response) ;
    			}
    		public void doPost(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException
    			{
    			    out = response.getWriter();
    				try
    					{
    						List a = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); 
    						out.println(a.size()) ; //just for testing, always producing zero
    						Iterator i = a.iterator() ;
    						while(i.hasNext())
    							{
    								FileItem fi = (FileItem)i.next() ;
    								if(!fi.isFormField())
    									{
    										out.println(fi.getFieldName()+" Name") ; //just for testing
    									}
    							}
    					}
    				catch(Exception e)
    					{
    						e.printStackTrace() ;
    						out.println(e) ;
    					}
    			}
    	}
    
    

    <html>
    	<head>
    	
    	</head>
    	<body>
    		<form name="xlsxfile" id="xlsxfile" action="http://localhost:8080/examples/uploadfile" method="POST"  enctype="multipart/form-data">
    					<a href="#" onclick="document.getElementById('fileID').click(); return false;" /> Upload File</a>
    					<input type="file" id="fileID" style="visibility: hidden;" onchange="storeStudents()"/>
    					<input type="submit" value="Submit"/>
    				</form>
    	</body>
    </html>
    
    
    
    
  4. In Topic: Cannot Transfer File Using Ajax

    Posted 18 Feb 2014

    Is there any problem with Content Type In the servlet, because I cannot find any other reason of failure....it now started giving response, it says- "undefined Students added to the list" whereas it should have returned some number....
    data.put("NOS",String.valueOf(nos)) ;
    
    
  5. In Topic: Java in 6 days?

    Posted 3 Feb 2014

    Thank you very much Mac.....

My Information

Member Title:
D.I.C Regular
Age:
22 years old
Birthday:
November 22, 1991
Gender:
Location:
Uttar Pradesh, India
Interests:
Writing poems, Innovating programs, Reading books, etc.
Years Programming:
5
Programming Languages:
Java

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://www.poemasdesired.blogspot.com
Yahoo:
Yahoo  rishabh_shar_123@yahoo.com
Facebook:
www.facebook.com/rdmighty

Friends

Comments

Page 1 of 1
  1. Photo

    arun1xxx Icon

    19 May 2010 - 01:34
    hi,
    can we become friens
Page 1 of 1