/**
* Copies the parameters from map to the BaseURL.
*
* @param url BaseURL
* @return void
*/
protected void setUrlParameters(BaseURL url) {
Set<String> keySet = parametersMap.keySet();
for (String key : keySet) {
List<String> valueList = parametersMap.get(key);
String[] valueArray = valueList.toArray(new String[0]);
url.setParameter(key, valueArray);
}
}
java类javax.portlet.BaseURL的实例源码
RooUrlTag.java 文件源码
项目:gvnix1
阅读 23
收藏 0
点赞 0
评论 0
BaseURLTag.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
/**
* Sets the secure flag on the URl as required
*
* @throws JspException
*/
protected void handleSecureFlag() throws JspException {
BaseURL url = getUrl();
if (secure != null && !secure.equalsIgnoreCase("true") && !secure.equalsIgnoreCase("false")) {
StringBuilder txt = new StringBuilder(128);
txt.append("Invalid secure option: ").append(secure);
txt.append(", valid options: true, false");
throw new JspException(txt.toString());
}
if(url == null){
throw new IllegalStateException("internal error: url not set");
}
if (var != null) {
pageContext.removeAttribute(var, PageContext.PAGE_SCOPE);
}
if (secure != null) {
try {
url.setSecure(isSecure());
} catch (PortletSecurityException e) {
// ignore exception as Pluto doesn't support setSecure
// throw new JspException(e);
}
}
}
BaseURLTag.java 文件源码
项目:portals-pluto
阅读 21
收藏 0
点赞 0
评论 0
/**
* Copies the properties from map to the BaseURL.
* @param url BaseURL
* @return void
*/
protected void setUrlProperties(BaseURL url) {
Set<String> keySet = propertiesMap.keySet();
for(String key : keySet){
List<String> valueList = propertiesMap.get(key);
for(String value:valueList){
url.addProperty(key, value);
}
}
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 22
收藏 0
点赞 0
评论 0
/**
* Sets the wrapped object.
*
* @param wrapped the wrapped object to set.
* @throws java.lang.IllegalArgumentException if the BaseURL is null.
*/
public void setWrapped(BaseURL wrapped) {
if (wrapped == null) {
throw new java.lang.IllegalArgumentException("BaseURL to wrap is null");
}
this.wrapped = wrapped;
}
TestPortletURLGenerationListener.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
private boolean isURLGenTc(BaseURL url) {
boolean ok = false;
String[] vals = (String[]) url.getParameterMap().get("tc");
if ((vals != null) && (vals.length > 0) && vals[0].contains("PortletURLGenerationListener")) {
ok = true;
}
return ok;
}
TestPortletURLGenerationListener2.java 文件源码
项目:portals-pluto
阅读 23
收藏 0
点赞 0
评论 0
private boolean isURLGenTc(BaseURL url) {
boolean ok = false;
String[] vals = (String[]) url.getParameterMap().get("tc");
if ((vals != null) && (vals.length > 0) && vals[0].contains("PortletURLGenerationListener")) {
vals = (String[]) url.getParameterMap().get("PUGL");
if ((vals != null) && (vals.length > 0) && vals[0].matches("^(?:Action|Render|Resource)$")) {
ok = true;
}
}
return ok;
}
ResourceURLTag286.java 文件源码
项目:portals-pluto
阅读 18
收藏 0
点赞 0
评论 0
@Override
protected void setUrl(BaseURL url) {
this.resourceURL = (ResourceURL)url;
}
PortletURLTag168.java 文件源码
项目:portals-pluto
阅读 23
收藏 0
点赞 0
评论 0
@Override
protected BaseURL getUrl() {
return portletURL;
}
PortletURLTag168.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
@Override
protected void setUrl(BaseURL url) {
this.portletURL = (PortletURL) url;
}
RenderURLTag362.java 文件源码
项目:portals-pluto
阅读 21
收藏 0
点赞 0
评论 0
/**
* prevent additional copying
*/
@Override
protected void setUrlParameters(BaseURL url) {
}
ActionURLTag362.java 文件源码
项目:portals-pluto
阅读 17
收藏 0
点赞 0
评论 0
/**
* prevent additional copying
*/
@Override
protected void setUrlParameters(BaseURL url) {
}
BaseURLTag.java 文件源码
项目:portals-pluto
阅读 25
收藏 0
点赞 0
评论 0
@Override
public int doEndTag() throws JspException{
BaseURL url = getUrl();
if(url == null){
throw new IllegalStateException("internal error: url not set");
}
setUrlParameters(url);
setUrlProperties(url);
HttpServletResponse response =
(HttpServletResponse) pageContext.getResponse();
// properly encoding urls to allow non-cookie enabled sessions - PLUTO-252
String urlString = response.encodeURL(url.toString());
if(Boolean.parseBoolean(escapeXml))
{
urlString = doEscapeXml(urlString);
}
if (var == null) {
try {
JspWriter writer = pageContext.getOut();
writer.print(urlString);
} catch (IOException ioe) {
throw new JspException(
"Portlet/ResourceURL-Tag Exception: cannot write to the output writer.");
}
}
else {
pageContext.setAttribute(var, urlString,
PageContext.PAGE_SCOPE);
}
/*cleanup*/
propertiesMap.clear();
parametersMap.clear();
removedParametersList.clear();
setUrl(null);
return EVAL_PAGE;
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
@Deprecated
@Override
public void setParameter(String name, String value) {
((BaseURL)wrapped).setParameter(name, value);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 21
收藏 0
点赞 0
评论 0
@Deprecated
@Override
public void setParameter(String name, String... values) {
((BaseURL)wrapped).setParameter(name, values);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 22
收藏 0
点赞 0
评论 0
@Deprecated
@Override
public void setParameters(Map<String, String[]> parameters) {
((BaseURL)wrapped).setParameters(parameters);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void setSecure(boolean secure) throws PortletSecurityException {
((BaseURL)wrapped).setSecure(secure);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 24
收藏 0
点赞 0
评论 0
@Deprecated
@Override
public Map<String, String[]> getParameterMap() {
return ((BaseURL)wrapped).getParameterMap();
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void write(Writer out) throws IOException {
((BaseURL)wrapped).write(out);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void write(Writer out, boolean escapeXML) throws IOException {
((BaseURL)wrapped).write(out, escapeXML);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 21
收藏 0
点赞 0
评论 0
@Override
public Appendable append(Appendable out) throws IOException {
return ((BaseURL)wrapped).append(out);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
@Override
public Appendable append(Appendable out, boolean escapeXML) throws IOException {
return ((BaseURL)wrapped).append(out, escapeXML);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void addProperty(String key, String value) {
((BaseURL)wrapped).addProperty(key, value);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
@Override
public void setProperty(String key, String value) {
((BaseURL)wrapped).setProperty(key, value);
}
BaseURLTag.java 文件源码
项目:portals-pluto
阅读 22
收藏 0
点赞 0
评论 0
/**
* Copies the parameters from map to the BaseURL.
* @param url BaseURL
* @return void
*/
@SuppressWarnings("deprecation")
protected void setUrlParameters(BaseURL url) {
Set<String> keySet = parametersMap.keySet();
for(String key : keySet){
List<String> valueList = parametersMap.get(key);
String[] valueArray = valueList.toArray(new String[0]);
url.setParameter(key, valueArray);
}
}
BaseURLTag.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
/**
* @return the url
*/
protected abstract BaseURL getUrl();
BaseURLTag.java 文件源码
项目:portals-pluto
阅读 18
收藏 0
点赞 0
评论 0
/**
* @param url the url to set
*/
protected abstract void setUrl(BaseURL url);
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 17
收藏 0
点赞 0
评论 0
/**
* @param wrapped the wrapped object to set.
* @throws java.lang.IllegalArgumentException if the BaseURL is null.
*/
public BaseURLWrapper(BaseURL wrapped) {
super(wrapped);
}
BaseURLWrapper.java 文件源码
项目:portals-pluto
阅读 22
收藏 0
点赞 0
评论 0
/**
* Gets the wrapped object.
*
* @return the wrapped object.
*/
@Override
public BaseURL getWrapped() {
return ((BaseURL)wrapped);
}