User Profile

Collapse

Profile Sidebar

Collapse
stack
stack
Last Activity: Nov 19 '09, 02:49 PM
Joined: Sep 16 '07
Location: UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • stack
    replied to Detect if JS is enabled
    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.
    See more | Go to post

    Leave a comment:


  • stack
    started a topic Detect if JS is enabled

    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
    See more | Go to post

  • stack
    replied to clear form data
    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.

    Code:
    response.sendRedirect("index.jsp");
    Thanks for all your help acoder!
    See more | Go to post

    Leave a comment:


  • stack
    replied to clear form data
    yes it does and I confirm to resend.
    See more | Go to post

    Leave a comment:


  • stack
    replied to clear form data
    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?

    thanks
    See more | Go to post

    Leave a comment:


  • stack
    replied to clear form data
    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")){
    ...
    See more | Go to post

    Leave a comment:


  • stack
    started a topic clear form data

    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...
    See more | Go to post

  • stack
    replied to Variables visible to all classes
    in Java
    True. I changed my design and everything makes sense now. Thank you for your input!...
    See more | Go to post

    Leave a comment:


  • stack
    replied to Variables visible to all classes
    in Java
    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(){
    ...
    See more | Go to post

    Leave a comment:


  • stack
    started a topic Variables visible to all classes
    in Java

    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
    ...
    See more | Go to post
    Last edited by pbmods; Jan 13 '09, 12:23 AM. Reason: Added CODE tags.

  • stack
    replied to validate input
    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.

    stack
    See more | Go to post

    Leave a comment:


  • stack
    started a topic validate input

    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
    See more | Go to post

  • stack
    replied to check for white space
    Reg exps drive me crazy. Thanks so much!

    Stack
    See more | Go to post

    Leave a comment:


  • stack
    started a topic check for white space

    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...
    See more | Go to post

  • stack
    started a topic Edit permissions MySQL Administrator

    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!
    See more | Go to post

  • stack
    replied to ResultSet columns
    in Java
    Yep, it worked. Thanks!!

    stack
    See more | Go to post

    Leave a comment:


  • stack
    started a topic ResultSet columns
    in Java

    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
    See more | Go to post

  • stack
    replied to Display image in JSP
    thanks! I 'll try that too....
    See more | Go to post

    Leave a comment:


  • stack
    started a topic Display image in JSP

    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
    See more | Go to post

  • stack
    replied to New to recursion
    in Java
    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...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...