Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

JSP prob?!?

  • 15-03-2006 3:21pm
    #1
    Registered Users, Registered Users 2 Posts: 1,991 ✭✭✭


    This is the code, basicly i want it to check the variable returned from getTitle and if it has nothin in it to print out 'Missing Title', its to work with a form and there will be more if statements for the other text fields but i cant get this to wor, i tried using syste.out.println but not sure if that only works on the console!?!?
    <td>
     <br>
    <%
    if (user.getTitle() == "")
    { %>Missing Title<% }
    %>
    </td>


Comments

  • Registered Users, Registered Users 2 Posts: 130 ✭✭irishfeller


    That should work - except that you should change the =="" to .equals("").

    '==' doesn't work for strings.


  • Closed Accounts Posts: 255 ✭✭full forward


    hi,
    try using the word null instead of ""


  • Registered Users, Registered Users 2 Posts: 1,991 ✭✭✭Ziycon


    nice one, got it, it was that i needed to use null instead, tanx!


  • Registered Users, Registered Users 2 Posts: 27,465 ✭✭✭✭GreeBo


    you should really do a null check and an emptystring check
    though depending on the source of getTitle() maybe empty string is unpossible :D


Advertisement