s_puria
s_puria

Reputation: 407

How to make an URL which contains the "id" of object?

How can I have an URL in Struts 2, which contains the id of an object, and then passes it to an action to show the object by this id?

E.g. the URL is /users/1 and it shows a user object which has the id =1.

Upvotes: 0

Views: 168

Answers (1)

Roman C
Roman C

Reputation: 1

To have parameters as a part of the path of the URL you should use an action mapper which is able to parse them when a request is processed by Struts.

In Struts you can find different action mapper implemented classes.

Upvotes: 1

Related Questions