JSP :: Making Sessions To Not Expire?
May 30, 2006
how this is done using session.setMaxInactiveInterval(); at first, i did not set anything but it expires anyway.so i'm trying not to let the session expire.session.setMaxInactiveInterval(0) does not work.
View Replies
ADVERTISEMENT
Apr 18, 2014
suppose a user logged in... after some time he want to get back to homepage...okk but suppose i want to get back to previous page by clicking back button on browser...but i dont want to go to login page until and unless i invalidate session...so wat settings i have to do on browser...so that i dont redirect to login page directly...
View Replies
View Related
Aug 14, 2014
Suppose we have two servlets runing inside same war on same server. When user access servlet A and create a session, he then open another tab or browser to access servlet B (session created by servlet A still exist). Inside servlet B, does
request.getSession()
return the session created by servlet A ?
View Replies
View Related
Feb 5, 2011
How to Expire the sending link to a mail after particular period of time
View Replies
View Related
Jul 22, 2014
I'm deployed application A and application B in TOMCAT server applications, the U1 user enters into the application A, he authenticates and generates a call to a page of the app B. As I was able to access the session of user U1 en A from B, it could have a single session.
View Replies
View Related
Jan 17, 2015
Okay I am new to web-programming in general and am confused about how sessions work-:
1) Are sessions stored only on the client computer ? If so then if cookies are disabled then if browsers only store the session how are they able to remember the exact JSESSIONID ? Also how does the server (like Tomcat) remember which JSESSIONID belongs to which user ? Where does it store that information ?
2) If the server also stores the session information then how fast does it become out of date ?
3) If a client has cookies disabled does the server maintain a key-value pair of the IP and the session-id, so that if the same client logs in then the same session-id will be appended ?
4) When does the web-container make the decision of using cookies or the encodeURL() method to embed the session info ?
I use Tomcat 8.0 for now.
View Replies
View Related
Jul 22, 2014
When we are caching an object, how to set expire time for that object by using pre defined methods?
View Replies
View Related
Jun 20, 2012
I got one task from my manager, regarding browser back button, refresh button. He asks me the web application has to work like Banks site... means if I refresh or click on Back button(Browser's) then it has to throw the user out of session, I checked lot in internet. But I found like only disabling back button of disabling F5 keys like that. But he’s not accepting that.
How to approach for this? Can we throw the user out of session when he clicks on browser back button or refresh button. I think its possible . But i don't know how to implement.
View Replies
View Related
Sep 17, 2014
I'm making an import/export of xml - I have the import of xml sorted I'm just trying to finish off the export. My export class is called XmlWriter.java. Inside the class I have an updateFile method to update an xml file as such:
public void updateFile(Environment environment,Document doc)
{
// code
}
I then in my main method have
public static void main(String argv[]){
//declare new object of class
XmlWriter xmlWriter = new XmlWriter();
//test testUpdate method
// xmlWriter.testUpdate();
Environment environment = ;
[code]....
I don't know what to make my variables equal to - eclipse keeps trying to use null but obviously that won't work. The Environment is another class that just contains getters and setters for the 3 different databases (that are in the xml file) and the getter/setter for the environment ID (also in xml file).
View Replies
View Related
Jan 10, 2014
How can I make an .exe file for my java project that will work on every computer?
I have a jar file, but the project can not work without installed IntellyJ or other development environment on that computer, i.e. it doesn't work only with installed java runtime.
What can I do to make an .exe file for my java project?
View Replies
View Related
Sep 29, 2014
I have a jsp with an img tag whose src is set to request a servlet to display a chart. This is called from another jsp form where user can select various filters. The first time the request is made all works great. but if the user changes the filter settings and and makes the servlet request a second time the chart stays the same. I have verified the new filter values are being set but the servlet is only being called on the initial request.at the head or called servlet I have(I also call a jquery empty on the div that holds the chart between requests. at the moment it just displays the former chart). It is like it is using cache:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setHeader( "Pragma", "no-cache" );
response.setHeader( "Cache-Control", "no-cache" );
response.setDateHeader( "Expires", 0 );
View Replies
View Related
Mar 9, 2014
I use JTable and JScrollpane in my java application, and I would like for every selected row in the scroll pane, the pie chart to be made for the values in % that the row contain.
View Replies
View Related
Oct 9, 2014
How would i go about making this NOT resizable?
If I do try to do ChatFrame.setResizable(false); it gives me this error:
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static method setResizable(boolean) from the type Frame
at com.ui.ChatFrame.<init>(ChatFrame.java:37)
at com.ui.ChatFrame$5.run(ChatFrame.java:403)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
[Code] ....
Here is the code:
package com.ui;
import com.socket.History;
import com.socket.Message;
import com.socket.SocketClient;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
[Code] ....
View Replies
View Related
Jan 22, 2014
I'm going to make Dekstop Based Home Inventory, do you have a tutorial for it ?
View Replies
View Related
Mar 10, 2014
I prompted the user to enter inches of rainfall for seven days and stored them in an array. Now, I am trying to display a histogram of this data using a nested loop, but for each inch, I have to display a * like this:
Rainfall Histogram:
****
***
**
******
********
**********
**
The only way I know how to display a number of *s according to user input is by an if statement. I copied and pasted from a similar class assignment I did, so what I have so far is pretty messy and nonsensical:
static char DetermineRainfall(int inches)
{
System.out.println("Histogram");
//char inches;
for(inches = 0; inches < 7; inches++)
{
for(int j = 0; j < 1; j++)
{
if (rainamount > .9 && rainamount <= 1)
inches = '*';
return inches;
}
}
View Replies
View Related
Nov 28, 2014
I am trying to run a Java applet (.jnlp) file through OSX. The purpose of the applet is to upload files to an SQL server. When I try to run the applet, I get an "Unable to launch the application" error because "No application resources are specified for this platform" After some digging , we noticed there are only resource instructions for "Windows".
Would there be any way possible to make this compatible in an OSX environment through a few alterations to the code, or would this be an issue that the original developers would have to resolve?
Here is the specific code pointing to the Windows Resources:
<resources os="Windows" arch="amd64">
<j2se version='1.6+' initial-heap-size="64m" max-heap-size="512m"/>
<jar href='http://192.168.1.140:7001/MagicInfo/uploader/uploader.jar' main='true' />
<jar href='http://192.168.1.140:7001/MagicInfo/uploader/lib/jnlp.jar' download="eager" />
<jar href='http://192.168.1.140:7001/MagicInfo/uploader/lib/transform.jar' download="eager" />
[Code] ....
View Replies
View Related
Apr 28, 2015
I am a student in an intro to computer science class working on my final project. This is essentially a game of connect 4, but only requiring 3-in-a-row for victory. We were given the base game and a sample file to work with to make an AI that beats our professor's ai in the base game. Here is the base game
package cs110.project3;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
[code].....
View Replies
View Related
Oct 22, 2014
so for my computer science class, we have the following problem:
In your documentation be sure to say which loop you thought was easier to implement for this program and why Write a program that produces the following outputs. The first line of output must be written using a For-Loop. The second, using a While-Loop and the third using a Do-Loop.
You look at the program and smile because you see that the series is just the numbers 1-10 squared...just one line is in reverse order. No problem! As you start typing you discover that the number 8 key on your keyboard is not working. For this program you are unable to use the multiplication key
So, back to the drawing board. By staring at the sequence a light comes on and you are able to quickly finish this program WITHOUT using mulitiplication (or the Math class/ solve with arithmetic operators +, - or / ) .
Sample output:
For Loop
1 4 9 16 25 36 49 64 81 100
While Loop
100 81 64 49 36 25 16 9 4 1
Do While Loop
1 4 9 16 25 36 49 64 81 100
I have the "for" done, but I did it with a "for" in the beginning but then had a multitude of nested "if" loops so that I could do 7*7=7+7+7+7+7+7+7
View Replies
View Related
Aug 14, 2014
I want users to input their phone Number But I want to make sure it is a phone number so they don't just do 1 and then leave it.
public static void main(String[] args) {
// Create the Scanner
Scanner in = new Scanner(System.in);
// Create the Variables
int phone;
if(phone > 100000000000 || phone < 100000000000) {
System.err.println("Error");
}
By the Way there are 12 digits in the if statement so that is 11 0's. Because all phone numbers are 12 digits.But when I run it, it comes up with an error saying The literal 100000000000000000000 of type int is out of range.I don't know how to make it so that the int has a limited number.
View Replies
View Related
Jun 14, 2014
I am having is not being able to print out the diamond the amount of times the user enters (for example, when it asks how many diamonds, I enter a 2 and only one diamond comes out.)
import java.util.Scanner;
public class Pattern5
{
public static void main(String[] args)
{
// For this pattern program, ask the user how many diamonds
// she would like to print to the screen. The following pattern is one diamond.
[code]...
View Replies
View Related
Mar 7, 2015
I am having a bit of trouble making the '+' add two numbers in java. For example:
When the user enters " + 4 5 " I want it to come out as " 4.00e+00 + 5.00e+00 = 9.00e+00 "
Here is what I have so far:
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextDouble()) {
double num1 = in.nextDouble();
double num2 = in.nextDouble();
String s = "";
[Code] .....
View Replies
View Related
Oct 2, 2014
I need to be able to call this method and it should take the object and, add it to my list of items, but I am having trouble getting it to work. I know the numbers and stuff aren't correct eventually it will add one to the array length when i call add item, but I am just trying to go one step at a time
//creates new MediaItem object and add it to items[]
void addNewItem(String title){
MediaItem object = new MediaItem(title);
MediaItem[] items = new MediaItem[1];
items[0] = ("object.getTitle()");
numberOfItems = numberOfItems + 1;
System.out.println(items[0]);
View Replies
View Related
Oct 13, 2014
I have been tasked with creating a coin Star simulator. This accomplishes which accomplishes the following tasks:
Prompts the user to enter coins:
(example inputs): (Note, these can't be like a numerical input followed by a word input, it needs to be one line)
4 quarters
3 dimes
0 pennies
All of which would be allowed inputs.
If an incorrect format is used it should tell the user to use the correct format of number space cointype
After every new input it should give a running total of the current money the system has stored.
this loop should continue until the user enters the phrase "finish"
Then, this system should output the money (minus 9.1% fee) in the largest denominations possible (up to $20)
So if the total came to $ 131.33 (after fee)
It should output:
6 twenties 1 tens 0 fives 1 singles 1 quarter 0 dimes 1 nickle 3 pennies.
and then maybe some cheeky text about how the machine stole your money.
The actual coding for me however is very difficult as I really don't know how to convert the string input from the user into usable numerical and substrings for the calculations.
I have some basic skeleton code worked out, but its only designed to run once.
import java.util.Scanner;
public class CoinStar {
Scanner input = new Scanner(System.in);
public static void main(String[] args) {
/** this first section is supposed to take the string from the user and separate it into two substrings,
* one integer, one word string
*
[Code] ....
View Replies
View Related
Jul 23, 2014
This might make me look pretty silly but I was curious if there was a way to make a dynamic web page in java. Basically only using pure Java, with only HTML5, CSS and mySQL.
View Replies
View Related
Aug 14, 2014
I want users to input their phone Number But I want to make sure it is a phone number so they don't just do 1 and then leave it.
public static void main(String[] args) {
// Create the Scanner
Scanner in = new Scanner(System.in);
// Create the Variables
int phone;
if(phone > 100000000000 || phone < 100000000000) {
System.err.println("Error");
}
By the Way there are 12 digits in the if statement so that is 11 0's. Because all phone numbers are 12 digits.But when I run it, it comes up with an error saying The literal 100000000000000000000 of type int is out of range.I don't know how to make it so that the int has a limited number.
View Replies
View Related
Jul 13, 2014
So I have this issue with ActionListener, I have created JMenuItems in a loop and applied them to JMenu's. But now when I want to make an action listener for each button, I'm not sure how to select them individually as in the loop it's 1 object looped through different names.
Here is the way I made the menu.
package com.simbaorka101.te.gui;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import com.simbaorka101.te.reference.Reference;
public class Menu extends JMenuBar{
private static final long serialVersionUID = 3601135828398064405L;
[Code] ....
View Replies
View Related