Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:33:37+00:00 2026-06-15T17:33:37+00:00

I start learning jsp application, and sometimes i got the error message something cannot

  • 0

I start learning jsp application, and sometimes i got the error message “something cannot be resolved…”. For example, this is my last report:

An error occurred at line: 118 in the jsp file: /functions.jsp
session cannot be resolved
115:             
116:     Boolean isLogged()
117:         {
118:             Boolean loginSuccess = (Boolean)session.getAttribute("myApp.loginSuccess");
119:             if (loginSuccess == null) 
120:             {
121:                 return false;

These lines refer to a function, that checks the success of the login procedure. So i have two questions:

  1. How can i fix the problem in this situation?
  2. What’s the reason of these messages, that sometimes disappears with no cause?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:33:37+00:00Added an answer on June 15, 2026 at 5:33 pm

    You need to cast the returned value of getAttribute() method.

    Boolean loginSuccess = (Boolean)session.getAttribute("myApp.loginSuccess");
    

    You can’t use implicit object variables directly into method body (declaration). You should have to avoid Java code in JSPs (Declaration, Scriptlet and Expression). Alternatively you can use use Servlet/Filter.

    To fix this issue declare a reference variable of HttpSession in declaration block.

    <%!
      HttpSession sess;
    
      Boolean isLogged(){
         Boolean loginSuccess = (Boolean)sess.getAttribute("myApp.loginSuccess");
         if (loginSuccess == null) 
            ...
      }
    %>
    

    and assign the reference of session object to sess variable before you call the isLogged method.

    e.g

    <%
     sess=session;
     if(isLogged()){
       //code
     }
    %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I start learning LINQ these days. I got an error when I try to
Where can I start learning Windows Form designing? For example: Microsoft Zune player, Buttons,
I got the Wrox.Beginning.JavaScript.3rd.Edition and wanted to start learning it from scratch, then my
I want to start learning about creating apps/games on the iPad 2. I cannot
I want to start learning Rx.js and I'm looking for a cool example to
I have recently started having a need to start learning Java Script. My application
A few days ago, I decided to start learning C#. So, I got a
I was about to start learning x64 assembly using this tutorial (series) but setting
I just start learning to write web services yesterday, kinda fascinating. I created an
I just start learning WPF, is that possible I can create an IE toolbar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.