JSP Unterminated< s:a>使用嵌套OGNL标记 [英] JSP Unterminated <s:a> Tag With Nested OGNL

查看:99
本文介绍了JSP Unterminated< s:a>使用嵌套OGNL标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些OGNL用于将< s:a> 的href元素填充到动态生成的URL中,由Google UserService处理。

I have some OGNL I am using to populate the href element of an <s:a> to a dynamically produced URL, handled by the Google UserService.

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="requestUri" value="%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}" />
<s:a href="%{#action.userService.createLoginURL("<c:out value="${requestUri}"/>");}">Sign in</s:a>

然而,我收到一条错误消息,说< s:a> 标记未终止。我已经尝试转义内部语音标记,并使用单引号但到目前为止,我一直都会收到相同的错误消息。

However, I am getting an error saying the <s:a> tag is unterminated. I have tried escaping inner speechmarks, and using single quotes but so far I have always been greeted with the same error message.

(11,71) Unterminated &lt;s:a tag

我不能终身我明白了什么是错的。也许对语言有更好眼光的人会看到我不能的东西。

I can't for the life of me see what is wrong. Maybe someone with better eyes for the language will see something I cannot.

推荐答案

你不能在Struts标签的属性中使用JSP标签,但是你可以在那里使用OGNL。

You cannot use JSP tags in Struts tag's attributes, but you can use OGNL there.

另请注意,您可以在Struts标记的属性中仅使用OGNL 。在大多数情况下,OGNL在服务器上执行一次,你不应该使用嵌套的OGNL或你称之为的任何东西。可以这个问题将向您展示如何使用您称为嵌套的OGNL

Also note, that you can use OGNL only in Struts tag's attributes. And in most cases OGNL is executed once on the server, you shouldn't use nested OGNL or whatever you call it. May be this question will show you how to use you called nested OGNL.

<s:set var="requestUri" value="%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}" />
<s:a href="%{#action.userService.createLoginURL(#requestUri)}">Sign in</s:a>

这篇关于JSP Unterminated&lt; s:a&gt;使用嵌套OGNL标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆