Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Jsp weird problem

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Jsp weird problem

    I'm trying to generate an html page with incoming emails for the user.
    The problem is that without errors my program suddenly stops the generation of the page after generating some stuff.
    here is a snip of this part of code that i have the problem:

    for (int i=0, n=message.length; i<n; i++) {
     
    			if(crudAction.equals("init"))				
    				is_new = es.checkIfIsNew(currentUser.getUser().getId(),folder.getUID(message[i]),message[i]);
     
    if(is_new){				
     
    				Statement stmt = db_con.createStatement();
    				SimpleDateFormat dateFormat,db_dateFormat;
    				dateFormat = new SimpleDateFormat("EEE d/MM/yyyy HH:mm:ss a") ;				
    				db_dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
    				String received_date,db_received_date;
    				received_date = dateFormat.format(es.getReceivedDate(message[i]));
    				db_received_date = db_dateFormat.format(es.getReceivedDate(message[i]));
    				String UID = folder.getUID(message[i]);
     
    				//getting the client with that incoming message email
    				get_client_pstmt.setString(1,message[i].getFrom()[0].toString());
    				ResultSet rs = get_client_pstmt.executeQuery();
    				if(rs.next()){
     
    					client_id = rs.getString("ID");
    					client_name = rs.getString("SURNAME") + " " + rs.getString("NAME");
     
    				}else{
    					client_id = "Uνknown";				 
    					client_name = message[i].getFrom()[0].toString();
    				}
     
    				System.out.println(i + ": " + message[i].getFrom()[0] 
    				  + "\t" + message[i].getSubject());				
     
    				if (i%2!=0) { %>
    					<tr class='vnetLineOdd'>
    				<% } else {  %>
    					<tr class='vnetLineEven'>
    				<% } %>
    					<td align="center"><input type="checkbox" class="email_rec" name="msg_<%=i %>" value="<%=UID %>"/></td>
    					<td <%=msg_seen %>><%=i+1 %></td>
    					<td><input type="button" class="vnetTabSelect" onclick="msg_num.value='<%=UID %>';crudAction.value='show_msg';target='_blank';this.form.submit();" value="Open"/></td>////Stops here..This line is generating 5 time insteed of 7;
    					<td <%=msg_seen %>><%=client_id %></td>								
    					<td <%=msg_seen %>><%=client_name %></td>
    					<td <%=msg_seen %>><%=message[i].getSubject() %></td>
    					<td <%=msg_seen %>><%=received_date%></td>
    					<td <%=msg_seen %>><%=message[i].getSize()/8 %>KB</td>
    					</tr>
    				<%  						
    				rs.close();	
    			}				
    		}

    After printing some results it's just stops in the line i comment in my code.
    Any ideas why is this happening??

    Thanks in advance..


  2. #2
    Junior Member
    Join Date
    Feb 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Jsp weird problem

    Solved.. I don't know why but the POP3folder was not open all the time in my code and when i was trying to close it at the end of my code it was just stoping the request proccess. So i put a folder.isOpen() check and is working fine.

Similar Threads

  1. ClassNotFoundException (bit weird)
    By chronoz13 in forum Exceptions
    Replies: 1
    Last Post: April 26th, 2011, 02:15 AM
  2. Weird issue with while loop ending/being skipped
    By ang3c0 in forum Loops & Control Statements
    Replies: 4
    Last Post: December 25th, 2009, 12:09 PM