Tutorial - Understanding how it works

Understanding how it works

Now all the graph is designed, save all files. When saving project, MVC Web Project automatically create a file named alveole-struts.xml.

This file is a struts2 file. Open it to understand how actions, views and links are mapped into struts:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!--
                        WARNING: This file was automatically generated from Eclipse Alveole Studio Plugin.
                        Do not edit it mannually: it will be erased automatically !
                        -->
<package name="alveole" extends="alveole-defaults">
        <action name="index" class="com.alveole.helloworld.Action" method="init">
                <result type="dispatcher" name="success">/jsp/init.jsp</result>
        </action>
        <action name="helloworld" class="com.alveole.helloworld.Action" method="hello">
                <result type="dispatcher" name="success">/jsp/hello.jsp</result>
        </action>
        <action name="close" class="com.alveole.helloworld.Action" method="close">
                <result type="dispatcher" name="success">/jsp/close.jsp</result>
        </action>
</package>
</struts>

Also open alveole-links.properties to understand how jsp taglib works to fin links by their name:

/jsp/init.jsp.next=/helloworld.action
/jsp/hello.jsp.next=/close.action

As you can see, for each JSP file, plugin automatically added all outgoing links, by name, and mapped it to the target context-relative path. When url taglib is called with a link attribute, it determines in which JSP file it currently runs, and it search the specified link using alveole-links.properties.