2011-07-11 23 views
0

プロジェクトが配置されているリモートアドレスまたはサーバアドレスを取得したい。サーバにデプロイされたプロジェクトのパスを取得する

http://www.myname.com/ : host 

deployedProj : deployed web App name 

folderName : there is a folder inside the web App 

i want to access this address : http://www.myname.com/deployedProj/folderName 
+0

は、私たちはここにあなたの質問に答えなかったと仮定しましょうか? http://stackoverflow.com/questions/6646679/in-jsp-get-realpath-of-deployed-project – Dirk

+0

@Dirk:静的なファイルパス名を取得する作業中です。 C:\ tomcat \ webapp \ myProject \ folderName \ –

+0

@Dirk:しかし、パス名を取得したい。 ** http:// localhost:8080/myProject/myFolder/** –

答えて

-1

あなたはrequestDispatcherにを使って、一つのことを行うことができます...

1.in servlet Action Class: req.getRequestDispatcher("/your_WebApp_Name/folder_inside_project").forward(req,res); 

e.g req.getRequestDispatcher("/deployedProj/folderName").forward(req,res); 

2. in JSP, 
<%=request.getRequestURL()%> 
関連する問題