Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Java [игнор отключен] [закрыт для гостей] / Struts 1.2 / 2 сообщений из 2, страница 1 из 1
21.01.2005, 14:04
    #32877250
concat
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Struts 1.2
хотим вон на струтс 1.2 переходить. прочитала, там есть всякие нужные новые фишки. Пользуется кто-то уже ими? Например такое в доке нашла:

автор...there are some new Action mapping techniques on the way in Struts 1.2. I like the new wildcard Action mapping features that Struts 1.2 offers: for instance, you can define an action like the following:

Код: plaintext
1.
2.
3.
4.
<action path="/edit*" type="org.apache.struts.webapp.example.Edit{1}Action" 
  name="{1}Form" scope="request" validate="false"> 
<forward name="failure" path="/mainMenu.jsp"/> 
<forward name="success" path="/{1}.jsp"/> 
</action> 
and the framework will automatically substitute, and look for, the corresponding match parameter. So the example above could generate an action mapping like:


Код: plaintext
1.
2.
3.
4.
<action path="/editAccount" type="org.apache.struts.webapp.example.EditAccountAction" 
  name="AccountForm" scope="request" validate="false">
<forward name="failure" path="/mainMenu.jsp"/>
<forward name="success" path="/Account.jsp"/> 
</action> 
There is also a nice feature, called mapping dispatch Actions. Basically this allows you to "overload" Action classes, and create an Action mapping to any method within that class that matches the Action::execute signature. As an example, you could write the following Action mappings:


Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
<action path="/createSubscription" 
          type="org.example.SubscriptionAction"
          parameter="create">
      <forward name="success" path="/editSubscription.jsp"/>
  </action>
 
  <action path="/editSubscription" 
          type="org.example.SubscriptionAction"
          parameter="edit">
      <forward name="success" path="/editSubscription.jsp"/>
  </action>
Which Struts can automatically map to the following methods within the SubscriptionAction class:



Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
 public  ActionForward create(ActionMapping mapping, 
                             ActionForm form, 
                             HttpServletRequest request, 
                             HttpServletResponse response)  throws  Exception

  public  ActionForward edit(ActionMapping mapping, 
                             ActionForm form, 
                             HttpServletRequest request, 
                             HttpServletResponse response)  throws  Exception


знает кто, что еще нового полезного в новой версии struts 1.2 есть?
...
Рейтинг: 0 / 0
24.01.2005, 14:37
    #32880177
mansch
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Struts 1.2
ждем версию 2.0 Shale! там действительно новое будет
...
Рейтинг: 0 / 0
Форумы / Java [игнор отключен] [закрыт для гостей] / Struts 1.2 / 2 сообщений из 2, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]