問題タブ [tiles2]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
struts2 - タイトルを動的に作成するにはどうすればよいですか?
struts2 と tiles(2) フレームワークで BBS を開発しています。
ActionSupport クラスに値をプッシュし、タイルの layout.jsp に値をポップしたいと考えています。しかし、私は値へのアクセスに失敗し続けています。
私の作品を順を追って説明します。
1) ユーザーはリンクをクリックして、一覧ページで記事を表示します。また、struts.xml で定義されているように BoardView クラスが呼び出されます。
--list.jsp--
<a href="view_board?num=${num}"> ${ subject } </a>
--struts.xml--
<action name="View_board" class="board.BoardView">
<result type="tiles">board.view</result>
</action>
2)アクションクラスはタイトルを値スタックに入れます...そうですか?
--BoardView クラス--
3) ActionClass が SUCCESS を返すと、board.view
--struts.xml--という名前のタイル定義に移動します。
<action name="View_board" class="board.BoardView">
<result type="tiles">board.view</result>
</action>
4) tiles-def.xml と問題は次のとおりです。「タイトル」の値は値スタックからポップできないと思います。
==tiles-def.xml==
(タグでインデントできません...ごめんなさい)
これがlayout.jsp ==layout.jsp==
<definition name="board.view" extends="layout">
<put-attribute name="title" value="%title" />
<put-attribute name="body" value="/board/view.jsp" />
</definition>
...
<title><tiles:getAsString name="title" /></title>
...
value 属性を %{title}、$title、${title} に置き換えてみました。しかし、何もうまくいきませんでした。Web ブラウザは、文字列 ($title) 自体を表示するだけです。
どうすればいいのかわからない...助けてください。
私の悪い説明にもかかわらず、私の作品を理解していただければ幸いです。
spring - How do I create a Spring 3 + Tiles 2 webapp using REST-ful URLs?
I'm having a heck of a time resolving URLs with Spring 3.0 MVC. I'm just building a HelloWorld to try out how to build a RESTful webapp in Spring, nothing theoretically complicated.
All of the examples I've been able to find are based on configurations that pay attention to file extensions ("*.htm" or "*.do"), include an artificial directory name prefix ("/foo") or even prefix paths with a dot (ugly), all approaches that use some artificial regex pattern as a signal to the resolver. For a REST approach I want to avoid all that muck and use only the natural URL patterns of my application. I would assume (perhaps incorrectly) that in web.xml I'd set a url-pattern of "/*" and pass everything to the DispatcherServlet for resolution, then just rely on URL patterns in my controller.
I can't reliably get my resolver(s) to catch the URL patterns, and in all my trials this results in a resource not found error, a stack overflow (loop), or some kind of opaque Spring 3 ServletException stack trace — one of my ongoing frustrations with Spring generally is that the error messages are not often very helpful.
I want to work with a Tiles 2 resolver. I've located my *.jsp files in WEB-INF/views/ and have a single line index.jsp file at the application root redirecting to the index file set by my layout.xml (the Tiles 2 Configurer).
I do all the normal Spring 3 high-level configuration:
...followed by all sorts of combinations and configurations of UrlBasedViewResolver, InternalResourceViewResolver, UrlFilenameViewController, etc. with all manner of variantions in my Tiles 2 configuration file. Then in my controller I've trying to pick up my URL patterns. Problem is, I can't reliably even get the resolver(s) to catch the patterns to send to my controller.
This has now stretched to multiple days with no real progress on something I thought would be very simple to implement. I'm perhaps trying to do too much at once, though I would think this should be a simple (almost a default) configuration. I'm just trying to create a simple HelloWorld-type application, I wouldn't expect this is rocket science.
Rather than me post my own configurations (which have ranged all over the map), does anyone know of an online example that: shows a simple Spring 3 MVC + Tiles 2 web application that uses REST-ful URLs (i.e., avoiding forced URL patterns such as file extensions, added directory names or dots) and relies solely on Spring 3 code/annotations (i.e., nothing outside of Spring MVC itself) to accomplish this? Is there an easy way to do this?
Thanks very much for any help.
spring - サイトメッシュとタイル 2.1 のスプリング MVC との統合
sitemesh と tiles 2.1 を spring mvc と統合することは可能ですか? レイアウトをタイルで合成して、サイトメッシュで飾りたい。
そんなタイルを使っていました。
次に、xml でサイトメッシュを構成します。
そして、デコレータを追加しました
しかし、これは何もしません。タイルはページを処理するためにサイトメッシュを回避すると思います。これを行う方法は?
これはsitemesh.xmlで、例に付属のデフォルトを使用しています
spring - タイル2およびURIを使用したHTTPリクエストのマッピングが見つかりません-Spring-MVC
Spring-Tiles統合を使用したい。ここで私のアプリがどのように見えるかを見ることができます。
だから私の質問は:なぜSpring-MVCディスパッチャーサーブレットが私のターゲットページを解決できないのですか?
spring - Spring 3 の UrlBasedViewResolver と Apache Tiles2
URL http://localhost:8080/app/clientes/agregarを開こうとしているときに、次の例外が発生しました。
私の mvc-config.xml は次のとおりです。
私の単純な tiles.xml:
/app の下の場所を開こうとすると、/app/welcome や /app/clientes のように正常に動作しますが、/app/clientes/something を開こうとするとこのエラーが表示されます。URL Resolver と何か関係があると思いますが、何を見つけることができません...
@Controller で注釈が付けられた私の ClientesController クラスには、次のようなメソッドがあります。
私の JSP ビュー ファイルは、次のように /WEB-INF/views の下にあります。
ありがとう!
apache - Apache Tilesは、使用してhtmlタグ属性を設定します価値
テンプレート フレームワークとして Apache Tiles 2.1 を (Spring MVC と共に) 使用しています。
Tiles 定義ファイル内から HTML 属性値を設定できる最善の方法を知りたいです。たとえば、テキスト ボックスがあり、定義内から maxlength 属性を設定できるようにしたいと考えています。私は次のことがうまくいくと思っていました -
この定義を使用して -
しかし、HTML タグ内に配置されている場合、Tiles は <insertAttribute/> タグを無視するようです。それ以外の場合は正常に動作します。
注: ViewPreparer を使用して、リクエスト スコープの値を設定しようとしました。これは機能しますが、まさに私が探しているものではありません。Tiles 定義内から HTML 属性値を簡単に設定したいと考えています。
java - Tiles2 は、定義内のすべてのスクリプトをグループ化しますか?
私は struts2+tiles2 を使用しており、次のことを行いたいと考えています。次のようにメニュー、ボディなどを定義する baseLayout があります。
そして、私の tiles.xml で、次のように設定しました。
そのため、本文で複数の jsp を使用できるより複雑なレイアウトがあり、この jsp の一部にはインライン スクリプトが含まれている場合があります。これらすべてのインライン スクリプトを同じ場所に追加するように設定する方法があるかどうかを知りたいです。たとえば、baseLayout でページ ヘッドを定義し、すべてのインライン スクリプトをこのヘッドに追加したいと考えています。これを行う方法があることを願っていますが、タイルのドキュメントが非常にわかりにくく、これを行う方法を発見していません。
ありがとう!
spring - Spring Security ログイン エラー メッセージが表示されないのはなぜですか?
Spring Security 3 を Struts 2 および Tiles 2 と共に使用すると、想定どおりにログイン ページが表示され、期待どおりにログインが実行されます。何が悪かったのか。すべての構成パラメーターを確認しましたが、どこに問題があるのかわかりません。
私の Spring Security XML 構成は次のとおりです。
私のStrutsアクションは次のようになります。
login.jsp ページ (タイルの一部) は、Spring Security からの例外を探します...
私が欠けているものを誰か教えてもらえますか?あらゆる/すべての返信に感謝します。
apache - タイルにテンプレートをネストすると、含まれるテンプレートで属性が定義されないのはなぜですか?
私は自分の Web アプリケーションで Tiles 2 を使用しています。また、tiles.xml ファイルで得た基本的なセットアップは次のとおりです。
レイアウトを定義する layout.jsp では、適切な場所にメニューを含めます。
そこで、メニュー テンプレート内で、tiles.xml で定義された homeClass 属性を使用したいと考えました。
しかし、homeClass 属性が定義されていないというエラーが表示されます。layout.jsp で insertAttribute を実行すると、値は適切に定義されますが、レイアウトに含まれるメニュー JSP で定義する必要があります。
それで、私の質問は次homeClass
のとおりです。レイアウト テンプレートだけでなく、レイアウト テンプレートから含まれるメニュー テンプレートにも属性を正しく渡す にはどうすればよいですか?
struts2 - put-attribute タグにカスケード属性がある Tiles2 エラー
なぜこのエラーが発生するのかわかりません:
tiles.xml は次のようになります (関連する部分のみ)。
value 属性も設定しようとしましたが、役に立ちませんでした。ここのドキュメントで見つけたカスケード属性
struts 2.1 および tiles 2.0.6 で netBeans 6.9 を使用しています。ide はコードヒントのカスケード属性を認識しません。