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 11 of 11

Thread: jsp css (Eclipse)

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

    Default jsp css (Eclipse)

    I have a project Spring, with JSP, i am now going to add a label into a jsp page, but i found that all the element in jsp are binded with css and each css will have it property.
    how can i debug how the system desgin about the jsp css desgin, any suggestion that i can add the element correctly. as i try to click the "design" screen in Eclipse. but it can't show the screen exactly. it seems all elements are binded by css.
    how to debug in Eclipse?

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

    Default control popup window during logon

    i am beginner of java project using eclipse. how can i create a one time popup window after each logon? how can i create a variable that can be get the value from another class or module?

    my step is below:
    1. user go to logon page
    2. user click logon button on logon page
    3. if logon successful, then redirect to home page (after login)
    4. popup window with "Close button" on it
    5. user read the message on popup window and click the "Close" button on popup window
    6. close popup window and visit the page.


    how can i control to popup the window once after logon the system? i am now create a <div> to show and hide the popup, but every time the user visit the page, it will prompts everytime, i don't want to popup everytime,, just only popup after logon system, does the control do in logon class?

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

    Default previous page jsp name

    <script src="Scripts/jquery-3.2.1.min.js"></script>
    <script>
    $(function () {
    var modal = $("#myModal");
    $("form").submit(function(e){
    alert('submit intercepted');
    e.preventDefault(e);
    modal.show();
    });
    $(".close").click(function () {
    modal.hide();
    })

    })

    </script>
    <style>
    body {
    font-family: Arial, Helvetica, sans-serif;
    }

    /* The Modal (background) */
    .modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }

    /* Modal Content */
    .modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    }

    /* The Close Button */
    .close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    }

    .close:hover,
    .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
    }
    </style>
    <body>
    <form id="form1" runat="server">
    <input type='submit'/>
    <!-- The Modal -->
    <div id="myModal" class="modal">

    <!-- Modal content -->
    <div class="modal-content">
    <span class="close">&times;</span>
    <p>Some text in the Modal..</p>
    </div>

    </div>
    </form>
    </body>

    how can i set java's session in js?
    Last edited by -_-"; June 25th, 2020 at 12:13 PM.

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

    Default how to get jsp document cookie

    i have a form in the jsp, how can i get the form/document cookie?

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

    Default Re: how to get jsp document cookie

    Do you have the API doc for that? I would look there.
    If you don't understand my answer, don't ignore it, ask a question.

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

    Default program life cycle for jsp servlet project?

    for the java project using jsp as front end handling. when i create a button and set the button type = "submit"
    when the user click the submit button, then the form will be submitted.
    but may i know the program life cycling for the jsp sevlet project?
    is it go the java program first and then execute to front end jsp ?
    when the jsp be executed when user click the button submit (form submitted)

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

    Default get previous url in jsp and check logic to prompt popup window

    let say i have login.jsp and home.jsp, when user input id and password and then click the normal button in logon.jsp, it will redirect to home.jsp page.
    in home.jsp page, how can i get the url of the previous page (login.jsp) in home.jsp
    and i need to check if the url=login.jsp, then i want to popup window, otherwise, it will hide the popup window.
    any example coding for me for reference, i am beginner seeking for help. thanks.

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

    Default Re: how to get jsp document cookie

    Quote Originally Posted by Norm View Post
    Do you have the API doc for that? I would look there.
    it is not API, just jsp.



    my project requirements is as below,

    1. create a logon jsp page with userid and password field
    and create 2 button , abnormal and normal button respectively. once the user click on it , it will submit form to servlet. it will redirect to the page home.jsp after successful logon.
    2. form home.jsp, I want to prompt a popup window when home.jsp is redirected from logon.jsp and triggered from normal button? NOT triggered by abnormal button.

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

    Default paring parameter to next service (submit form)

    if the user click the submit button, then the form will be submitted. and then forward to the next jsp page (home.jsp)
    in home.jsp, how can i know what information i can get from the previous submit form?

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

    Default get prevous jsp information from current jsp.

    i have login.jsp page with 2 input field and 2 buttons, nomal and abnormal button respectively.
    when normal button click, it will submit form and redirect to home.jsp
    when abnormal button is clicked, it will submit form and redirect to home.jsp too.

    in main.jsp, how can i check which button the user click in login.jsp to redirect to main.jsp
    to display different <h1> content in main.jsp depending on previous page.

    ------------------------------------------------------------login.jsp---------------------------------------------------------------


    login.jsp

    <html>
    <body>

    <form action = "main.jsp" method = "POST">
    First Name: <input type = "text" name = "first_name">
    <br />
    Last Name: <input type = "text" name = "last_name" />
    <input type = "submit" value = "normal_submit" />
    <input type="submit" value="abnormal_submit"
    </form>

    </body>
    </html>

    --------------------------------------------------------------------Main.jsp -------------------------------------------
    Main.jsp
    <html>
    <head>
    <title>Using GET and POST Method to Read Form Data</title>
    </head>

    <body>
    <center>
    <%=if abnormal submit button click%>
    <h1>this is abnormal button click</h1>
    </if=%> //how to check value ?
    <%= if normal button click%>
    <h1> this is redirect from normal button click</h1>
    </if =%>

    <ul>
    <li><p><b>First Name:</b>
    <%= request.getParameter("first_name")%>
    </p></li>
    <li><p><b>Last Name:</b>
    <%= request.getParameter("last_name")%>
    </p></li>
    </ul>

    </body>
    </html>

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

    Default set and get hidden value in form submit processing (jsp)

    hwo can i set the hidden field value when form submission. and get this hidden value from next jsp page?

Similar Threads

  1. Replies: 4
    Last Post: October 3rd, 2013, 05:25 PM
  2. Replies: 2
    Last Post: September 25th, 2013, 03:35 PM
  3. Replies: 1
    Last Post: October 20th, 2012, 12:21 PM
  4. Beginners Eclipse Tutorial. How to run first java application on Eclipse?
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 13
    Last Post: June 24th, 2011, 12:26 AM