• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

jsp run on server option not coming

I am trying to run my jsp by right clicking on the file---> run as---->Run on server.

But it is not showing 'Run on server'

It only shows 'Run Configuration'

How do I see option 'Run on server'

As a work around i am setting welcome file in web.xml with this jsp to run.

Please advise. Any ideas, sample code, resources highly appreciated. Thanks

in advance.
  • 6
  • 3
1 Solution
chaitu chaituCommented:
does JSPProject is a web project or java project?
Sathish David Kumar NArchitectCommented:
your does not code contain <form> tag its important ML(Jsp) page.

if your page contain <form> tag then only your reganice that its web page then only it will come run on server
gudii9Author Commented:
It is web project.

let me try with form tag and see.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

gudii9Author Commented:
form tag is usually on html page right. Does jsp pages consist of form tag. i want to run jsp pages without form tag. how to do it.Please advise.
Sathish David Kumar NArchitectCommented:
its main for jsp also .

because that form tag only knows where to go next ! (normaly you mention action ="some java class or jsp  " like that . )

You cant run the jsp page without form tag . because jsp is convert into servlet while compile. that servlet class only your IDE ref . if form tag is there then its web so its enable run on server .
gudii9Author Commented:
If you see the Loin.jsp file do have the form ta. Still it is not showin 'Run as Server' option' as in the attachment. Not sure why. Please advise

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <base href="<%=basePath%>">
    <title>Login page</title>
      <meta http-equiv="pragma" content="no-cache">
      <meta http-equiv="cache-control" content="no-cache">
      <meta http-equiv="expires" content="0">    
      <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
      <meta http-equiv="description" content="This is my page">
      <link rel="stylesheet" type="text/css" href="styles.css">


 <form method="post" action="loginservletpath">
 <br>User Id:<input type="text" name="userId">
 <br>Password:<input type="password" name="password"/>
<br> <input type="submit">
gudii9Author Commented:
Does MyEclipse Show 'Run on server' option at all. please advise
gudii9Author Commented:
any links to learn how to run servlets, jsps on myeclipse. please advise
Sathish David Kumar NArchitectCommented:
change the prespective to j2ee mode i think its in java mode .

in your MyEclispe right corner you can see the prespetive
gudii9Author Commented:
oh really, my OS crashed. I will try by reinstalling later
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now