|
adeel1981 wrote: mysql.jdbc.driver is not being loaded.
OK, then you need to investigate why that is so. But from the information you have given here it is anyone's guess what is going wrong.
Programming is work, it isn't finger painting. Luc Pattyn
|
|
|
|
|
In that case you should hope for heavenly help.
I can just tell you to use the tools that you are given.
|
|
|
|
|
I made a list of string and store data inside it ,then i made a code on this list after that i have results....my question is i want to take this results and store it in list of string . how i do that????
|
|
|
|
|
Create another list and add each result to it.
|
|
|
|
|
|
Are you trying to keep the results on same List? Because I wonder, if you have already create a List and store data, you should not stuck with creating another List and store the results in that new List. Could you please clarify, so I can help you further if required.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi to all,
public class xyz {
public static int gUserID = 1;
}
When 1st user Login gUserID value is = 5
and second user login gUserID value is = 7
Problem is 1st user refresh or re-direct to another page gUserID is changing to 7.
How to set Global variable for session or any solution to above problem.
Thanks.
|
|
|
|
|
How is the variable being updated?
The single variable is used by every instance of the class. If you want each instance to have a userId then you need something like this:
public class Test {
private static int nextUserId = 1;
private int userId;
public Test() {
this.userId = Test.nextUserId++;
}
public int getUserId() {
return this.userId;
}
}
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Hi Nagy Vilmos,
I m update gUserID from database. As soon as login to application. I m setting corresponding user id to that variable and I m utilizing that variable in complete project as global variable.
here I m facing problem. As soon as 2nd person login The Value is reset (2nd user id is updating).
I m trying your method now Thanks.
|
|
|
|
|
Now I understand.
You have an instance for each user, so the variable must not be static . If it is possible to set the value in the constructor, then that is the best thing because you can make the member variable final and so it cannot be changed.
It is strongly advised to not expose member variables outside the class, it is ALWAYS better to use in this case a method; as I used in my example. If the variable is final , then you can to some extent relax the rule as there is no way it can be changed; but this is normally reserved for constants.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
my +5.
I would like to point out that the UserID should also be an automatically created number that the user object should not modify - it's hard to identify the data otherwise.
|
|
|
|
|
Nanda_MR wrote: How to set Global variable for session
You start by researching how to handle session data in a web application.
|
|
|
|
|
Hi,
I have a problem on getting the project path of a web application.
Reason on getting the project path is I'm uploading a PDF Files to the project path so that I can open it to the browser, I'm hoping to do this http://localhost:8080/PDFviewer/UploadedFiles/sample.pdf .
I have found something in the Internet but the path is not in my project path
getServletContext().getRealPath("/");
My project path is D:\Java\Java Web Projects\PDFviewer but the above code is giving me D:\Java\Java Web Projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\PDFviewer
Can anybody please suggest a way of getting the application path in java.
Thanks...
|
|
|
|
|
The path the system gives you is correct, because the web server is placed in the wtpwebapps folder.
Try to deploy it and see if the path comes up correct on a test system. I assume so.
|
|
|
|
|
Thank you very much it work perfectly what I expected...
Even if its not in my Eclipse Web Project it can view the pdf.
|
|
|
|
|
you're welcome.
This can be confusing, one is never secure to not struggle on such things.
|
|
|
|
|
yes, I'm really confused...
I can't see the uploaded files in my Eclipse App..
|
|
|
|
|
want to convert the content of video to byte in java could any body help me to do that?
|
|
|
|
|
|
Please anybody help me to implement Video Conferencing in my project Virtual Classroom using Java Media Framework and servlet.
Thanks
|
|
|
|
|
|
What is exact diff. between the operator,constructor and method overloading.....Give some examples also....
|
|
|
|
|
Classes and Objects[^]
Overriding Methods[^]
I can recommend to by a good book explaining the basics. And I can recommend to read them even one has already worked in the business( kind of back to roots)
|
|
|
|
|
when i want to deploy my application in tomcat server it can't and this is the error message
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Undeploying ...
undeploy?path=/Mango
OK - Application non-déployée pour le chemin de contexte /Mango
In-place deployment at D:\PFE\Mango\build\web
deploy?config=file%3A%2FC%3A%2FUsers%2FBouali%2FAppData%2FLocal%2FTemp%2Fcontext4268238340729989227.xml&path=/Mango
FAIL - Deployed application at context path /Mango but context failed to start
D:\PFE\Mango\nbproject\build-impl.xml:847: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 2 seconds)
I await your answers in short delays. thank you in advance
|
|
|
|
|
The build script is already telling you what you should be doing next. Locate and look into the catalina.out file for more details as to why the web app failed to start.
As to where the catalina log files are, that depends greatly on what type of Tomcat install this is. If it's integrated in Netbeans then it's located in the .netbeans/7.1.1/apache-tomcat/logs.
If it is a debian / ubuntu based linux its found under /var/log/tomcat
In either case the catalina log will show the root cause of the failure to start. But it's most likely something in the web.xml that is wrong.
|
|
|
|