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 8224987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:15:36+00:00 2026-06-07T15:15:36+00:00

i have a logout link in jsp and i call the logout function like

  • 0

i have a logout link in jsp and i call the logout function like this

function logout(){
    document.getElementById("functiontype").value="logout";
    document.forms["frmTempcard"].submit();               
}

i call this like following : <li><a href="#" onclick="logout()">Logout</a></li>

when i click on the link i see the following url : http://localhost:8080/acct/notifier[the jsp file is there in this folder only ]/TempCardServlet

when i remove the folder name in url it is working fine. so how to redirect to desired servlet?

Please help me.

  • 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-07T15:15:38+00:00Added an answer on June 7, 2026 at 3:15 pm

    You should look at the action attribute of form, as per the code you have shared and the problem description, I feel you need to update action of your form.

    Currently you would have given action='TempCardServlet' which means submit the request to TempCardServlet residing in the same URL as the current JSP page. This is relative path reference.

    When you specify action='SomePath' then browser submits request to http://server/currenturl/SomePath. If the path to which you need to submit the request is not in current path then you need to either specify relative path or absolute path in following manner:

    Relative Path (in your case): action='../TempCardServlet' – this method is not recommended as relative path might break your application

    Absolute Path with Application context: action='/acct/TempCardServlet' – this would refer to servlet on the same server, drawback of this is that you are hard-coding applicaiton context. To overcome this you can use Servlet API to get current application context and append it to your servlet path – you can also use standard tag libraries to get the context path appended.

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

Sidebar

Related Questions

I have a link like this: <%= link_to Logout, destroy_user_session_path, :method => :delete %>
I have a simple GAE app that includes a login/logout link. This app is
I have a login link that fires a javascript function that calls a logout
I have link like this: http://localhost/BandTemplate/admin/galleries How can I get to the last segment
I have set UserIsOnlineTimeWindow =2 in web.config then my logout() function has been modified
I have a button like this: <Button android:id=@+id/logout_button android:layout_width=fill_parent android:layout_height=wrap_content android:text=Log out /> and
I have this urls on urls.py url(r'^login/$', 'django.contrib.auth.views.login', {'template_name':'login.html'}), url(r'^(one|two)/logout/$', 'django.contrib.auth.views.logout_then_login', {'login_url':'/login/'}) I'm trying
In the logout link button click event I have cleared the session variables. I
in views.py I have this: def logout(request,key): auth.logout(request) return HttpResponseRedirect(reverse('airAgency.views.index',args=[key])) in index template i
I have an issue with my login functionality. When user clicks the logout link

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.