User Profile
Collapse
-
Thank you both for your answers. Yes acoder that was what I was trying to avoid :-). I don't know if you 're using gmail. If you try to login to your account and JS is disabled, the page won't load. This is what I would like to accomplish if possible. -
Detect if JS is enabled
Hi all
I 'm writing a small web app and I would like to know what ways there are to check if the users' browser has JS enabled. I know I can create a page that redirects to a different page using JS but I was wondering if there is a better way of doing it, e.g. do it from the same page.
Thanks a lot
stack -
You were right. Fortunately the solution was much simpler.... Using a redirect the browser can reload a URL without repeating the original request (or at least this is what I understood by doing some googling)
So adding following code in line 9, solves the problem.
Thanks for all your help acoder!Code:response.sendRedirect("index.jsp");Leave a comment:
-
-
acoder thank you for your answer.
I tested what you said but that's not it. I still see the old information in my form (the reload() was working anyway). Maybe it is a JSP issue after all :-)
Any more suggestions?
thanksLeave a comment:
-
index.jsp
...Code:<jsp:useBean id="bean" scope="session" class="myPack.bean" /> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <% if (request.getMethod().equalsIgnoreCase("POST")){Leave a comment:
-
clear form data
Hi all,
I am creating a web app using JSP. I have a bean with some variables whose values are set by the user by using a form in a jsp (method is post). When the user enters those values these are stored in my bean and they are available to all my jsps since I'm creating a "session". So, after the submission of the form the values are still displayed in the form and this is exactly what I want. In my jsp I have an if statement... -
True. I changed my design and everything makes sense now. Thank you for your input!...Leave a comment:
-
Jkmyoung and r035198x thank you both for your help.
r035198x, I did what you said and it worked. However, in order to make the Set (inside the Use) available in my main, I had to declare it static and therefore access it with the class name from main. If it's not static, how can I make it available in my main?
...Code:public class Use { static Set set1 = new Set(); public void useN(){Leave a comment:
-
Variables visible to all classes
Hi,
I wrote these 3 classes to explain my question:
...Code:public class Set { private BigInteger n; Random ran = new Random(); public void setN(){ n = new BigInteger(5, ran); } public BigInteger getN(){ return n; } } public class Use { Set set1 = new Set(); public void -
Thanks for the link, it is indeed a very good article. I guess a prepared statement would serve my purpose since I'm writing JSP.
stackLeave a comment:
-
validate input
hi
I wrote a website (for a coursework) where users are able to leave their comments and these comments are stored in the database. I need to check therefore for invalid input characters such as backslashes, quotes etc. My question is what are all characters that can make my application crash or even worse can delete data from the db? And also, is the validation usually done on the client or server?
Thanks -
-
check for white space
Hi,
Can you please tell me if you see anything wrong in my function? It doesn't return true if the string tested contains spaces.
[HTML]
function hasWhiteSpace(s trg) {
var whiteSpaceExp=/^\s+$/;
if (whiteSpaceExp. test(strg))
return true;
else
return false;
}
[/HTML]
The string passed is that: document.form1. un.valu... -
Edit permissions MySQL Administrator
Hi all,
How can I see/change permissions to alter table data using MySql Administrator? Of course I googled it first but I can't find the answer.
Thanks! -
-
ResultSet columns
Hi all,
I have a ResultSet object and I want to get the nbr of columns it has. It's easy to find the number of rows by using the absolute(int row) and the getRow() methods. Is there anything similar to find the nbr of columns? Any relevant code or advice would help.
Thanks a lot -
-
Display image in JSP
Hi all,
I include an image tag in a JSP page but when I run the JSP file it does not display the image.
[HTML]<img src="1.jpg" height="100"/>[/HTML]
Is that the right way to do it?
Thank you -
I draw a tree for all fib calls where every node has 2 children (n-1) and (n-2) and now everything makes sense :-)
Thanks again!
stack...Leave a comment:
No activity results to display
Show More
Leave a comment: