|
|
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
Передаю на jsp страничку параметр items типа SortedSet И на jsp страничке мне нужно взять его первый елемент. Я пытаюсь его достать с помощью Код: plaintext 1. Код: plaintext 1. но происходит ошибка : Код: plaintext 1. Код: plaintext 1. Как я могу взять первый елемент SortedSet ??? Может кто-то уже сталкивался с этой задачей, подскажите. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2006, 19:27 |
|
||
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
автормне нужно взять его первый елемент. почему тогда <c:set .../> Код: plaintext 1. 2. 3. 4. Data is saved using a mechanism called scoped variables. A scoped variable has a name, which is of type String and a value, which is of type Object. For non-page scoped variables, it is recommended that the name use the reverse domain name convention (e.g., prefixed with com_mycompany) to minimize unexpected collisions when integrating with third party modules. В вашем случае: Код: plaintext 1. 2. 3. 4. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 10:53 |
|
||
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
Спасибо за инфу, но чесно говоря я не нашел в ней ответа на мой вопрос :( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 12:25 |
|
||
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
несилен в JSTL, что-то в этом роде Код: plaintext ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 12:28 |
|
||
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
ТимоНнесилен в JSTL, что-то в этом роде Код: plaintext Пробывал, но постоянно получаю ошибку, которую описал раньше. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 12:35 |
|
||
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
Neglecting to Store Variables in a Scope Although it's not recommended for production code, it is not uncommon for developers to create some temporary objects in a scriptlet that act as placeholders for data that will eventually come from another source; for example, you can create a hash map in a scriptlet that you can subsequently access with an EL expression, like this: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. You may think that the preceding code fragment will display the value of the first entry added to the map, but in actuality, it will display nothing at all because the map created in the scriptlet was never stored in one of the JSP scopes. Once the map is placed in one of the JSP scopes, it can be accessed with an EL expression. Here is the corrected code fragment: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. You can iterate over the items stored in the map created above like this: Код: plaintext 1. 2. http://www.phptr.com/articles/article.asp?p=30946&seqNum=10&rl=1 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 12:46 |
|
||
|
SortedSet и JSTL
|
|||
|---|---|---|---|
|
#18+
Writing Output to the JspWriter There are four general-purpose tags. The <c:out> tag is probably the tag that you will see the most. It is used to output to the current JspWriter. This is similar to using the JSP expression <%=scripting language expression %> to write dynamic data to the client. The value to be written to the JspWriter is specified as a value attribute. You can use expressions in the value attribute. This allows for the resulting evaluation to be sent to the JspWriter. The <c:out> tag can perform XML character-entity encoding for <, >, &, ", and '. This means that a < will be automatically encoded to <. The book includes a table of the XML entity values that are used for encoding the characters. Therefore, it's possible also to use this encoding capability to encode any HTML, such as <br>, so that the angle brackets appear correctly. This capability is controlled by the escapeXml attribute. It defaults to true. It should be obvious that: The title of the book you just purchased is <c:out value="${sessionScope.bookInfo.title}"> is much easier to read (and write) than: <%@page import="com.mk.jstl.bookInfo"%> <%BookInfo bookInfo =(BookInfo)session.getAttribute" ("bookInfo"); %> The title of the book you just purchased is <%=bookInfo.getTitle()%> In another example, we might want to output some data values that have been stored in a scoped variable called myData. The value of myData is "<b>I love to ride my bicycle</b>". There are HTML tags included in the string that we want to make sure are rendered correctly, with the string bolded. To ensure that the data is displayed to the user correctly, we would use: <c:out value=${myData}escapeXml="false"/> With escapeXml set to false, our users see the correct display with the text bolded. Otherwise, they just see the characters <b> displayed with the text, as shown in Figure 1. The two displays are shown as they would appear if you were to view the source of the resulting file in your browser. The first output is using the default value of escapeXml, while the second output shows the result of using escapeXml set to false. With escapeXml defaulting to true: <b>I love to ride my bicycle</b> With escapeXml set to false: <b>I love to ride my bicycle</b> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 12:48 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=718&tid=2148919]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
44ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
31ms |
get tp. blocked users: |
1ms |
| others: | 251ms |
| total: | 361ms |

| 0 / 0 |
