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

  • Home
  • SEARCH
  • 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 6742067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:47:57+00:00 2026-05-26T11:47:57+00:00

I am developing a struts based application on google app engine. I am using

  • 0

I am developing a struts based application on google app engine. I am using google’s user service to allow users to log into my application.

When the user is signed into his google account and opens my application, my application must not ask to sign in again. Suppose the homepage of my application is index.jsp, it should say

Welcome user xyz@gmail.com

To do so, I have to check whether there is a current user or not like this

<%
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
if(user == null)
    //login link
else
    //Welcome message
%>

But I am not supposed to use scriptlets in my application. I have to achieve this using struts tags.

Any help is greatly appreciated. Thank you all in advance and good day.

  • 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-05-26T11:47:58+00:00Added an answer on May 26, 2026 at 11:47 am

    First of all, you need to register the user logged in the session. You must create an action where you will put the code that does the checking account with Google:

    public LoginAction {
    
        @Action(...)
        public String login () {
            UserService userService = UserServiceFactory.getUserService();
            User user = userService.getCurrentUser();
            ActionContext.getContext().getSession().put("user", user);
            return "success";
        }
    }
    

    Then you will have the user available on any jsp. The jsp code would be something like:

    <s:if test="#session.user == null">
        //login link
    </s:if>
    <s:else>
        //Welcome message
    </s:else>
    

    When the user logs off, you just have to remove the session object.

    And if you need to log off the user if he does in his Google account, you will need an interceptor that will check if it is still logged all the time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have
I am developing a web application using Struts 1.2.7 I want to print a
I am developing a Java EE web application using Struts. The problem is with
I am developing a web application using Apache Struts, to be deployed on JBoss
iam developing iPhone application that allow user to define stations near to him, so
I just started developing a web application using struts 1.3.10 tiles framework. There is
I am developing a small application using Struts, Spring and hibernate3. But now I
I am developing a JSR-286 compliant portlet based on struts 1.2.9 (for historical reasons
I use tomcat. I am developing a web application using struts2, and I use
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.

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.