Commit 039981eb authored by Bill Lynch's avatar Bill Lynch Committed by bill

Relative URL fixes


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@509 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2ef2ce85
...@@ -18,6 +18,7 @@ import javax.servlet.jsp.tagext.BodyTagSupport; ...@@ -18,6 +18,7 @@ import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.JspWriter;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.io.IOException; import java.io.IOException;
...@@ -153,7 +154,7 @@ public class SidebarTag extends BodyTagSupport { ...@@ -153,7 +154,7 @@ public class SidebarTag extends BodyTagSupport {
*/ */
public int doEndTag() throws JspException { public int doEndTag() throws JspException {
// Start by getting the request from the page context // Start by getting the request from the page context
ServletRequest request = pageContext.getRequest(); HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
// Check for body of this tag and the child tag // Check for body of this tag and the child tag
if (getBodyContent().getString() == null) { if (getBodyContent().getString() == null) {
...@@ -228,7 +229,8 @@ public class SidebarTag extends BodyTagSupport { ...@@ -228,7 +229,8 @@ public class SidebarTag extends BodyTagSupport {
value = StringUtils.replace(value, "[id]", clean(subitemID)); value = StringUtils.replace(value, "[id]", clean(subitemID));
value = StringUtils.replace(value, "[name]", clean(subitemName)); value = StringUtils.replace(value, "[name]", clean(subitemName));
value = StringUtils.replace(value, "[description]", clean(subitemDescr)); value = StringUtils.replace(value, "[description]", clean(subitemDescr));
value = StringUtils.replace(value, "[url]", clean(subitemURL)); value = StringUtils.replace(value, "[url]",
request.getContextPath() + "/" + clean(subitemURL));
} }
String css = getCss(); String css = getCss();
boolean isCurrent = item.equals(current); boolean isCurrent = item.equals(current);
...@@ -271,7 +273,8 @@ public class SidebarTag extends BodyTagSupport { ...@@ -271,7 +273,8 @@ public class SidebarTag extends BodyTagSupport {
svalue = StringUtils.replace(svalue, "[id]", clean(sibID)); svalue = StringUtils.replace(svalue, "[id]", clean(sibID));
svalue = StringUtils.replace(svalue, "[name]", clean(sibName)); svalue = StringUtils.replace(svalue, "[name]", clean(sibName));
svalue = StringUtils.replace(svalue, "[description]", clean(sibDescr)); svalue = StringUtils.replace(svalue, "[description]", clean(sibDescr));
svalue = StringUtils.replace(svalue, "[url]", clean(sibURL)); svalue = StringUtils.replace(svalue, "[url]",
request.getContextPath() + "/" + clean(sibURL));
} }
buf.append("<li class=\"").append(subcss).append("\">").append(svalue).append("</li>\n"); buf.append("<li class=\"").append(subcss).append("\">").append(svalue).append("</li>\n");
} }
......
...@@ -18,6 +18,7 @@ import javax.servlet.jsp.tagext.BodyTagSupport; ...@@ -18,6 +18,7 @@ import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.JspWriter;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.io.IOException; import java.io.IOException;
...@@ -114,7 +115,7 @@ public class TabsTag extends BodyTagSupport { ...@@ -114,7 +115,7 @@ public class TabsTag extends BodyTagSupport {
* @throws JspException if an exception occurs while rendering the tabs. * @throws JspException if an exception occurs while rendering the tabs.
*/ */
public int doEndTag() throws JspException { public int doEndTag() throws JspException {
ServletRequest request = pageContext.getRequest(); HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
String beanName = getBean(); String beanName = getBean();
// Get the page data bean from the request: // Get the page data bean from the request:
AdminPageBean pageInfo = (AdminPageBean)request.getAttribute(beanName); AdminPageBean pageInfo = (AdminPageBean)request.getAttribute(beanName);
...@@ -143,7 +144,8 @@ public class TabsTag extends BodyTagSupport { ...@@ -143,7 +144,8 @@ public class TabsTag extends BodyTagSupport {
if (value != null) { if (value != null) {
// The URL for the tab should be the URL of the first item in the tab. // The URL for the tab should be the URL of the first item in the tab.
value = StringUtils.replace(value, "[id]", clean(tab.attributeValue("id"))); value = StringUtils.replace(value, "[id]", clean(tab.attributeValue("id")));
value = StringUtils.replace(value, "[url]", clean(tab.attributeValue("url"))); value = StringUtils.replace(value, "[url]",
request.getContextPath() + "/" + clean(tab.attributeValue("url")));
value = StringUtils.replace(value, "[name]", clean(tab.attributeValue("name"))); value = StringUtils.replace(value, "[name]", clean(tab.attributeValue("name")));
value = StringUtils.replace(value, "[description]", clean(tab.attributeValue("description"))); value = StringUtils.replace(value, "[description]", clean(tab.attributeValue("description")));
} }
......
...@@ -129,7 +129,7 @@ public class PluginManager { ...@@ -129,7 +129,7 @@ public class PluginManager {
List urls = adminElement.selectNodes("//@url"); List urls = adminElement.selectNodes("//@url");
for (int i=0; i<urls.size(); i++) { for (int i=0; i<urls.size(); i++) {
Attribute attr = (Attribute)urls.get(i); Attribute attr = (Attribute)urls.get(i);
attr.setValue("/plugins/" + pluginDir.getName() + "/" + attr.getValue()); attr.setValue("plugins/" + pluginDir.getName() + "/" + attr.getValue());
} }
AdminConsole.addModel(adminElement); AdminConsole.addModel(adminElement);
} }
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</div> </div>
</td> </td>
<td width="1%" id="jive-logout" nowrap> <td width="1%" id="jive-logout" nowrap>
<a href="index.jsp?logout=true">Logout [<%= StringUtils.escapeHTMLTags(admin.getUser().getUsername()) %>]</a> <a href="<%= path %>/index.jsp?logout=true">Logout [<%= StringUtils.escapeHTMLTags(admin.getUser().getUsername()) %>]</a>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment