-3

terms_span.jsp

            <jsp:include page="/includes/inc_terms_span.jsp">
                <jsp:param name="list" value="true" />

            </jsp:include>

inc_term_span.jsp

<%String showaslist = request.getParameter("list"); System.out.println("show list? "+showaslist); 
    if(showaslist!=null && showaslist.equalsIgnoreCase("true")){
%>

<p> Welcome to the page </p>

else
{%>

<p> error in the connection </p>
<%}%>
Asaph
  • 159,146
  • 25
  • 197
  • 199
user2916626
  • 9
  • 1
  • 5

2 Answers2

0

Your 2nd block of code is a bit of a mess of scriptlet tags.

At the start you have

<%String ...

I'm not certain, but you might need a gap between the scriptlet tag and the java:

<%
  String ...

Right after the else theres a closing tag %> without a matching <%

Try tidying that up and see where you get...

NickJ
  • 9,380
  • 9
  • 51
  • 74
0

Following NickJ's answer, I see 2 further mistakes made.

  1. The file name inc_terms_span.jsp you want to include is (maybe) written wrong, because you show us the content of inc_term_span.jsp.

  2. At the line if(showaslist!=null && showaslist.equalsIgnoreCase("true")){ there's an opening bracket {, but you never close it before the else.

Try this code to fix it:

<%
String showaslist = request.getParameter("list"); 
System.out.println("show list? " + showaslist); 
if(showaslist != null && showaslist.equalsIgnoreCase("true")) {
%>

<p> Welcome to the page </p>

<%}
else
{%>

<p> error in the connection </p>

<%}%>
Christian St.
  • 1,751
  • 2
  • 22
  • 41