I am reading mail by using pop3 in java mail. In outlook I found we can leave the copy of mail in server side after reading. Shall we do that process in java mail ?
BIFFVIEWER REQUIRES A FILENAME*** java.lang.NullPointerException at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer. java:68) at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer .java:649)
When I long click item in the list nothing happens. I get no errors at all and I believe that either I put the code in the wrong place or I missed something else that stops Dialog from starting.
I'm having problems with using the h:inputFile tag with JSF 2.2 and Glassfish 4.0 on Eclipse. The file uploads work when the enctype is set to "multipart/form-data" in the h:form tag, but AJAX will not work. When I leave out the encType (defaults to "application/x-www-form-urlencoded") AJAX works but the uploads do not work, and in fact Glassfish crashes and generates the message:
The request content-type is not a multipart/form-data
Likewise I'm having the same problems with the PrimeFaces file upload tag p:fileUpload. In a JSF 2.0 it works correctly, but with JSF 2.2 it's giving the same problems and generates the message above.
When I start up Eclipse it tells me that Mojarra 2.2.0 is installed. Is this the source of the problem, and if so, how do I install a later version of Mojarra?
My program is reading my file, but its printing out weird cryptic numbers instead of the 1-10 that is in the file. But it uses the numbers in the file to get the Max Value and Total. Also I am receiving 0 for my Minimum Value but, 0 isn't even in the file, my lowest value is 1.
Java Code: /*
* Student Name: Irrelavent * * Description: This program will read from a text file and display its contents in an array format as well as the average of the numbers and the minimum and maximum value within the array and it will display the total of all the numbers added together. * * Input Variables: * * Desired Output: * Total: 55 Average: 5.5 Minimum Value: 1.0 Maximum Value: 10.0 The data being used is: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] */
I want 1 for my Minimum and I want 5.5 for my average, when I make 'average = total / numbers.length;' ---> 'average = total / (double)numbers.length;' I get 0.55. Also, as its obvious, my 'Numbers being used' section is messed up and I don't know whats causing this.
I have datatable with live scrolling enabled.The columns are not getting sorted fully.When one of the columns is sorted,for example "insured" in the image shown below, all the records seem to have sorted but when i reach the end of scroll and next set of records get loaded i see other records in unsorted order as indicated in the image ,when i try to see the column in descending order.So because of this i am not getting the sorting feature accurately done(All records are not getting sorted at a single stretch)
I am adding my shopping cart in session like bellow in servlet
HttpSession session = request.getSession(); session.setMaxInactiveInterval(60*30); // 30 minutes if (session.getAttribute("cart") == null){ session.setAttribute("cart", new ShoppingCart()); } cart = session.getAttribute("cart");
I seems if more than one person accesses it from server, if they items in the shopping cart, all the product is added to a single session. I mean if i added 4 items first and other person adds 2 items, second person sees 6 products in his cart. Where am I going wrong?
Object in my main class, it doesn't work as its supposed to. I might be implementing it wrong.
Java Code:
public PostOrderIterator<E> implements Iterator<E>{ Deque<BNode<E>> somestack = new LinkedList<BNode<E>>(); BNode<E> position; public POIterator(BNode<E>root){ somestack = new LinkedList<BNode<E>>(); somestack.push(root);}
public void savePlants(ArrayList flowerPack) throws IOException { Scanner input = new Scanner(System.in); String name;
[Code].....
When I open the saved file the information I need seems to be saved, but when I try to load and search it the data is not there. This is homework that was due about 2 days ago. I just want to get it right in my head for next time.
So far i've built an array of char W= wall, O=open, R= rat, and P= path
I have another class "RAT" which will navigate through the maze. so im having trouble with the method to get the position of the rat when it is navigating through maze. this is what i have.
public class FinalMaze { static char[][] mazeArray = new char[][] { {'o','o','o','o','o','o'}, {'o','w','w','r','w','o'}, {'o','w','p','p','w','o'}, {'o','w','p','w','w','o'}, {'o','w','p','p','w','o'}, {'o','w','w','p','w','o'}, {'o','w','w','p','w','o'}, {'o','o','o','o','o','o'}, };
I have to write a code for File Transfer Protocol! It says that I only need to write code for client, but it also says that I have to run the program and send some files to server. I guess than I also need server side as well. I have to write my own classes, I cannot import some existing classes. I have to connect to the server with password and username and after that send some files to the server. I don't know anything about FTP. Can i maybe do this by Sockets and ports? I worked something with that.
i have this code to connect and login to a HTTPS website Now when i run it i get a 500 code error and if i print out the html of the website it says something went wrong. This is the website [URL]
I have to write a client and server class for a UDP protocol sending integer numbers by UDP packets. So far i have this;
Client Code:
import java.io.*; import java.net.*; class UDPClient { public static void main(String args[]) throws Exception { BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
[Code] ....
But i now need to change this so that:
The client;
1. Reads an integer from keyboard input and stores its value in a UDP packet. // byte[] send = ByteBuffer.allocate(4).putInt(num).array(); ???
2. Sends the UDP packet to the server, on port number 1999;
3. Listens for UDP packets from the server (until it receives a packet with a non-positive number; see step (b) below). While listening:
(a) Once it receives a UDP packet from the server, it subtracts 2 from the integer value num contained in it. // int num = ByteBuffer.wrap(receive).getInt(); ??? (b) Checks the integer value num: if the value is greater than 0 (num>0) then the client stores it in a new UDP packet and sends the packet to the server; otherwise (num<=0) the client terminates.
The Server;
1. Listens on port 1999;
2. For each UDP packet it receives from a client: (a) extracts the integer value n contained in it; (b) decreases the value of n by 2; (c) sends back to the client a UDP packet containing the new value of n.
I'm trying to turn into an android app, but I have limited Java knowledge.It's not a super complex app so I figured I could figure it out on the fly with some tutorials and such. But I need to emulate this curl connection and I'm not sure how in Java.
How to make my program look nice. I have to create a mortgage calculator with no functionality, so it basically just has to be a window that looks like this:
Here's my code:
import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MortgageCalculator { public static void main(String[]args) { CalcWindow calculator = new CalcWindow();
[Code] .....
Here is the output I am getting:
How do I make my program output look similar to the 1st picture?
I am unable to understand the use of String intern. Why not use Code 1 as given below instead of using intern as in Code 2? Both perform the same functionality.
I am trying to implement a file upload functionality. One of the requirement is to display a 'Please Wait!!!' message to the user while the upload is going on. My project currently uses JSF 1.2, Tomahawk, JQuery 1.9, JQuery UI 1.10. I am aware that this can be accomplished using a4j with richfaces, however I am not supposed to add any new library to the existing project. how this can be done?
Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587; nested exception is: java.net.SocketException: Permission denied: connect at com.readAlerts.SendEmailUsingGMailSMTP.main(SendEmailUsingGMailSMTP.java:63) Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587; nested exception is:
[Code]...
Tried every permutation and combination but all leading to this same error.
Am trying to develop a web application, and am using the Entity Manager. The web application involves users posting data to the database. How do I incorporate the entity manager together with the prepared Statement functionality to avoid users corrupting the database with SQL tags?
If I have EJB database session beans, when the content of the database changes, does the information on the web page get automatically updated dynamically on the client machine?
I am unable to run this java mail code, whats the error!!
public class Class1 { final String senderEmailID = "from@gmail.com"; final String senderPassword = "password"; final String emailSMTPserver = "smtp.gmail.com"; final String emailServerPort = "465"; String receiverEmailID = null;
[Code] ...
I get an error as this
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1949) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654) at javax.mail.Service.connect(Service.java:317)