You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _pages/en/aspectran/user-guide.md
+24-32Lines changed: 24 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,8 +58,8 @@ Aspectran provides two main ways to define a Translet.
58
58
59
59
```xml
60
60
<transletname="/user/info">
61
-
<actionbean="userDao"method="getUserInfo"/>
62
-
<transformformat="json"/>
61
+
<actionbean="userDao"method="getUserInfo"/>
62
+
<transformformat="json"/>
63
63
</translet>
64
64
```
65
65
The example above defines a Translet that, upon receiving a `/user/info` request, executes the `getUserInfo` method of the `userDao` bean and responds with the result transformed into JSON format.
@@ -113,13 +113,13 @@ Aspectran provides two main ways to define a Translet.
113
113
114
114
```xml
115
115
<transletname="*"scan="/WEB-INF/jsp/**/*.jsp">
116
-
<description>
117
-
This automatically finds all JSP files in the '/WEB-INF/jsp/' directory and its subdirectories and registers them as Translets.
118
-
The path of the discovered jsp file is specified as the value of the file attribute of the template element.
119
-
</description>
120
-
<dispatch>
121
-
<template/>
122
-
</dispatch>
116
+
<description>
117
+
This automatically finds all JSP files in the '/WEB-INF/jsp/' directory and its subdirectories and registers them as Translets.
118
+
The path of the discovered jsp file is specified as the value of the file attribute of the template element.
119
+
</description>
120
+
<dispatch>
121
+
<template/>
122
+
</dispatch>
123
123
</translet>
124
124
```
125
125
The rule above scans for all `.jsp` files in the `/WEB-INF/jsp/` directory and its subdirectories, and dynamically creates and registers Translets based on the file paths. For example, if a file `/WEB-INF/jsp/user/list.jsp` is found, a Translet named `user/list` is created. This feature is very useful for serving a large number of static view files and dramatically reduces repetitive Translet definitions.
@@ -540,11 +540,9 @@ AsEL uses three main tokens to access data in different scopes.
540
540
* **`${...}` (Parameter Token)**: Accesses the **parameters** of the current request. It is mainly used to reference path variables or request parameters of a Translet.
541
541
```xml
542
542
<transletname="/users/${userId}">
543
-
<actionbean="userService"method="deleteUser">
544
-
<arguments>
545
-
<itemvalue="${userId}"/> <!-- Passes the userId parameter extracted from the URL path as an argument to the action -->
546
-
</arguments>
547
-
</action>
543
+
<actionbean="userService"method="deleteUser">
544
+
<argumentvalue="${userId}"/> <!-- Passes the userId parameter extracted from the URL path as an argument to the action -->
545
+
</action>
548
546
</translet>
549
547
```
550
548
@@ -553,25 +551,19 @@ AsEL uses three main tokens to access data in different scopes.
<!-- The result of the above action is stored as an attribute named 'userResult' -->
555
553
<dispatchname="user/detail">
556
-
<attributes>
557
-
<itemname="user"value="@{userResult}"/> <!-- Passes the 'userResult' attribute to the view template as 'user' -->
558
-
</attributes>
554
+
<attributename="user"value="@{userResult}"/> <!-- Passes the 'userResult' attribute to the view template as 'user' -->
559
555
</dispatch>
560
556
```
561
557
562
558
* **`#{...}` (Bean Token)**: Accesses a **bean or a bean's property** registered in the IoC container. It is useful for referencing static configuration values or the results of other bean method calls.
<!-- Passes the value of the defaultPageSize property of the appConfig bean as an argument -->
573
-
<itemvalue="#{appConfig.defaultPageSize}"/>
574
-
</arguments>
565
+
<!-- Passes the value of the defaultPageSize property of the appConfig bean as an argument -->
566
+
<argumentvalue="#{appConfig.defaultPageSize}"/>
575
567
</action>
576
568
```
577
569
@@ -864,16 +856,16 @@ The `transform` response is used to directly generate the response body by conve
864
856
***JSON Conversion**: Use `format="json"` to convert the processing result into a JSON string. This is most commonly used in REST APIs. Adding the `pretty="true"` attribute will format the output for readability.
When `resourceManager` is created, `initialize()` is called after its `resourcePath` property is set. When the application shuts down, `cleanup()` is called.
@@ -560,7 +560,7 @@ When using `<bean scan="...">`, you can use `<filter>` to include or exclude spe
560
560
<beanscan="com.example.app.**">
561
561
<filter>
562
562
exclude: [
563
-
"*.*Repository"
563
+
*.*Repository
564
564
]
565
565
</filter>
566
566
</bean>
@@ -594,10 +594,8 @@ You can also define required parameters for the translet. If a required paramete
594
594
```xml
595
595
<transletname="/users/view"method="GET">
596
596
<request>
597
-
<parameters>
598
-
<!-- The 'userId' parameter is mandatory for this translet. -->
599
-
<itemname="userId"mandatory="true"/>
600
-
</parameters>
597
+
<!-- The 'userId' parameter is mandatory for this translet. -->
598
+
<parametername="userId"mandatory="true"/>
601
599
</request>
602
600
...
603
601
</translet>
@@ -617,10 +615,8 @@ The "content" section of a translet (represented by `<content>` or implicitly by
617
615
<!-- Call the 'getUser' method on the 'userService' bean -->
618
616
<!-- The return value will be stored in an attribute named 'user' -->
Copy file name to clipboardExpand all lines: _pages/ko/aspectran/user-guide.md
+24-32Lines changed: 24 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,8 +58,8 @@ Aspectran은 Translet을 정의하는 두 가지 주요 방법을 제공합니
58
58
59
59
```xml
60
60
<transletname="/user/info">
61
-
<actionbean="userDao"method="getUserInfo"/>
62
-
<transformformat="json"/>
61
+
<actionbean="userDao"method="getUserInfo"/>
62
+
<transformformat="json"/>
63
63
</translet>
64
64
```
65
65
위 예제는 `/user/info` 요청이 들어오면 `userDao` 빈의 `getUserInfo` 메소드를 실행하고, 그 결과를 JSON 형식으로 변환하여 응답하는 Translet을 정의합니다.
@@ -113,13 +113,13 @@ Aspectran은 Translet을 정의하는 두 가지 주요 방법을 제공합니
113
113
114
114
```xml
115
115
<transletname="*"scan="/WEB-INF/jsp/**/*.jsp">
116
-
<description>
117
-
'/WEB-INF/jsp/' 디렉토리 하위 경로에서 모든 JSP 파일을 찾아서 Translet 등록을 자동으로 합니다.
118
-
검색된 jsp 파일의 경로는 template 요소의 file 속성 값으로 지정됩니다.
119
-
</description>
120
-
<dispatch>
121
-
<template/>
122
-
</dispatch>
116
+
<description>
117
+
'/WEB-INF/jsp/' 디렉토리 하위 경로에서 모든 JSP 파일을 찾아서 Translet 등록을 자동으로 합니다.
118
+
검색된 jsp 파일의 경로는 template 요소의 file 속성 값으로 지정됩니다.
119
+
</description>
120
+
<dispatch>
121
+
<template/>
122
+
</dispatch>
123
123
</translet>
124
124
```
125
125
위 규칙은 `/WEB-INF/jsp/` 디렉터리와 그 하위 경로에 있는 모든 `.jsp` 파일을 스캔하여, 파일 경로에 따라 동적으로 Translet을 생성하고 등록합니다. 예를 들어, `/WEB-INF/jsp/user/list.jsp` 파일이 발견되면 `user/list`라는 이름의 Translet이 생성됩니다. 이 기능은 정적인 뷰 파일을 대량으로 서빙할 때 매우 유용하며, 반복적인 Translet 정의를 획기적으로 줄여줍니다.
@@ -540,11 +540,9 @@ AsEL은 세 가지 주요 토큰을 사용하여 서로 다른 스코프의 데
540
540
* **`${...}` (파라미터 토큰)**: 현재 요청의 **파라미터(Parameter)**에 접근합니다. 주로 Translet의 경로 변수(Path Variable)나 요청 파라미터(Request Parameter) 값을 참조하는 데 사용됩니다.
0 commit comments