You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Graham Leggett <mi...@sharp.fm> on 2009/11/03 23:43:05 UTC

ognl.InappropriateExpressionException: Inappropriate OGNL expression: 1

Hi all,

I am currently attempting to pass a URL to struts, with information
embedded in the URL (restful style).

So far this works, if I point a browser at /foo/000014/invoice.shtml,
the correct action is picked up and the right method is called:

	@Action("**/invoice*.shtml")
	public String shtml() throws Exception {
		return execute();
	}

The problem is, the following warning is being logged to catalina.out:

WARNING: Error setting expression '1' with value '/000014'
ognl.InappropriateExpressionException: Inappropriate OGNL expression: 1
	at ognl.SimpleNode.setValueBody(SimpleNode.java:312)
	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
	at ognl.SimpleNode.setValue(SimpleNode.java:301)
	at ognl.Ognl.setValue(Ognl.java:737)

Is there a way to suppress this warning at tell ognl to stop trying to
parse the URL?

Is there another best practice method I should be using to achieve this?

I found the REST plugin for struts which seems hopeful, but the
documentation for the REST plugin is incomplete - it makes a vague
reference to me needing to implement a "ContentTypeHandler" to handle
xml, json, html, etc output, but offers no links or clues as to how this
is to be achieved. Does anyone know if documentation exists on how to do
this?

Regards,
Graham
--

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ognl.InappropriateExpressionException: Inappropriate OGNL expression: 1

Posted by Musachy Barroso <mu...@gmail.com>.
Can you post the whole stacktrace to see what it is trying to do? REST
is mostly undocumented. If what you need are restful urls, and not the
other rest functionality, I would suggest you to just use wildcards.

musachy

On Tue, Nov 3, 2009 at 2:43 PM, Graham Leggett <mi...@sharp.fm> wrote:
> Hi all,
>
> I am currently attempting to pass a URL to struts, with information
> embedded in the URL (restful style).
>
> So far this works, if I point a browser at /foo/000014/invoice.shtml,
> the correct action is picked up and the right method is called:
>
>        @Action("**/invoice*.shtml")
>        public String shtml() throws Exception {
>                return execute();
>        }
>
> The problem is, the following warning is being logged to catalina.out:
>
> WARNING: Error setting expression '1' with value '/000014'
> ognl.InappropriateExpressionException: Inappropriate OGNL expression: 1
>        at ognl.SimpleNode.setValueBody(SimpleNode.java:312)
>        at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>        at ognl.SimpleNode.setValue(SimpleNode.java:301)
>        at ognl.Ognl.setValue(Ognl.java:737)
>
> Is there a way to suppress this warning at tell ognl to stop trying to
> parse the URL?
>
> Is there another best practice method I should be using to achieve this?
>
> I found the REST plugin for struts which seems hopeful, but the
> documentation for the REST plugin is incomplete - it makes a vague
> reference to me needing to implement a "ContentTypeHandler" to handle
> xml, json, html, etc output, but offers no links or clues as to how this
> is to be achieved. Does anyone know if documentation exists on how to do
> this?
>
> Regards,
> Graham
> --
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org