Programming Tutorials

(追記) (追記ここまで)

Using Multiple Message Resource Bundles in Struts

By: Jagan in Struts Tutorials on 2007年09月22日 [フレーム]

We will use a different message resource bundle to store information about images.

a. Create a new file called ImageResources.properties under src/java/struts.example directory (You can do this within Eclipse). Move the following entries from MessageResources.properties to ImageResources.properties:

image.beerchug=images/beerchug.gif
image.beerchug.alttext=It's Beer time
image.save=images/save.gif
image.save.alttext=Save the Form
image.cancel=images/cancel.gif
image.cancel.alttext=Cancel Submission

b. In the struts-config.xml, declare the new ImageResources.properties file as a Resource Bundle as
follows:
<message-resources parameter="struts.example.ImageResources"
key="bundle.image" null="false"/>

c. For each of the image tag that corresponds to these images, change the tags in JSPs to use the
bundle="bundle.image"




(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /