Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: Spring = how to defect first time visitor

  1. #1
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Spring = how to defect first time visitor

    1. my project is using Spring, and it call specific java method, then the page will be loaded, how can i defect if the user is first time logon, if yes, then prompt a popup window when load, the popup window will close when user click on "Close" button.
    2. when user re-visit / refresh the page, the page will NOT prompt popup window when they re-visit after logon.

    how to write in Spring project with jsp?

    the following is my jsp popup window coding...

    ------------
    <body>
    <style>
    .modal {
    display: block;
    position: fixed;
    z-index: 999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    }
    </style>
    <div id="Dialog" class="modal" tabindex="-1" />
    --------------------------------------------------------------------

  2. #2
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default create session

    i am beginner of Spring project using jsp. how can I create session, and the value can be retrieved in that application

  3. #3
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java set and get value

    my project Spring project is using java, jsp to develop the system, and each page will have it class
    when the user login the system, they need to input id and password, after that the system will retrieve the user's Profile and set value into LOGIN class for example

    login class {

    private username;
    public string getUsername {
    return username;
    }

    public void setusername (string name){
    this.username=name;
    }

    when the user go to another page, it will have it own class, may i know if I can get the username whenever the user is still login in system? when the username value will be discarded?
    when user go to another page, can i still get username value?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: java set and get value

    my project Spring project
    The question is about how to use the API for the Spring framework. It just happens that java is the connecting language. A knowledge of Spring is required for this project. If you have the API doc for what you are trying to do and have a java programming question about how to use it, post the API doc and your question.

    Sorry, I do not know Spring or jsp.


    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default redirect jsp

    I have a two button on logon page, name as a and b button, after clicking these 2 button, it will redirect to same page let say it is next.jsp
    but now I only want to prompt popup window when the a button is clicked, how can I know what button to click to redirect to next.jsp page?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: redirect jsp

    Please post your code that shows the problem.
    Be sure to wrap the code in code tags.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default get previous url

    for xml file, for different logic, it may redirect to different jsp page, how to know the previous jsp name or URL from next java/jsp ?

    <?xml version="1.0" encoding="UTF-8"?>
    <LOGONFlow>


    <htmlProcessor context="LONONCt" id="LOGONFLOW">
    <htmlState id="initial" type="initial">
    <transitions>
    <htmlTransition do_nothing="false" id="initial.start" targetState="LOGONop"/>
    <htmlTransition do_nothing="false" id="initial.warning" targetState="WARNING"/>
    </transitions>
    </htmlState>

    <operationState typeIdInfo="LOGONop" id="LOGONop" type="operation">
    <transitions>
    <htmlTransition do_nothing="false" id="ok" targetState="INPUT"/>
    <htmlTransition do_nothing="false" id="App" targetState="M_INPUT"/>
    </transitions>
    </operationState>


    <htmlState typeIdInfo="INPUT.jsp" id="INPUT" type="page">
    <transitions>
    <htmlTransition do_nothing="false" id="INPUT.next" targetState="ValidateOp"/>
    </transitions>
    </htmlState>
    </LOGONFlow>

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: get previous url

    Why post xml in a java programming forum?
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Spring = how to defect first time visitor

    Spring project include this type of file.