You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Error formatting macro: snippet: java.lang.NullPointerException

DefaultActionMapper

By default, the DefaultActionMapper is used:

Error formatting macro: snippet: java.lang.NullPointerException

Method prefix

Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException

Action prefix

Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException

Redirect prefix

Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException

Redirect-action prefix

Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException

Custom ActionMapper

You can define your own ActionMapper by implementing org.apache.struts2.dispatcher.mapper.ActionMapper then configuring Struts 2 to use the new class in struts.xml

<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts" class="com.mycompany.myapp.MyActionMapper" />

Possible uses of the ActionMapper include defining your own, cleaner namespaces, such as URLs like /person/1, which would be similar to a request to /getPerson.action?personID=1 using the DefaultActionMapper.

CompositeActionMapper

Error formatting macro: snippet: java.lang.NullPointerException

Next: RestfulActionMapper

  • No labels