Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Pass the context path into a custom tag

843835Feb 18 2003 — edited Feb 24 2003
Here is a snapshot of the custom tag:

// setter for tag attribute
public void setAction(String action) {
this.action = action;
}
public int doStartTag() throws JspTagException {

// ...

// print out <form> tag and hidden input for startIndex
try {
JspWriter out = pageContext.getOut();
out.print("<form");
out.print(" method=\"" + request.getMethod() + "\"");
out.println(" action=\"" + action + "\">");
out.println(" <input type=\"hidden\" name=\"" +
listTag.getParamPrefix() + listTag.getStartIndexParam() +
"\" value=\"" +
(listTag.getStartIndex() + listTag.getNumItems()) + "\">");
out.print(" <input type=\"hidden\" name=\"" +
listTag.getParamPrefix() + listTag.getNextParam());
out.println("\" value=\"true\">");
} catch(IOException ioe) {
//Debug
System.out.println("NextFormTag: error printing <form> tag");
}
return(EVAL_BODY_INCLUDE);
}

Now, in a JSP file, I have

<mm:prevForm action='...'>
<td align="left"><input type="submit" value=="previous"/> ></td>
</mm:prevForm>

I need to pass a path <%=request.getContextPath()%>/jsp/quicksearchlist/page.jsp into the action. How can I do it right with the context path?

Thanks,

v.

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 24 2003
Added on Feb 18 2003
6 comments
253 views