- - PR -
HTMLからJSPへ
| 投稿者 | 投稿内容 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
投稿日時: 2004-03-18 21:08
現在、strutsを使用しPGしているのですが、HTMLで作成したweb画面がjspに変換して画面上に表示しようとした時に、画面名.jspなら表示されるのですが.doで表示しようとした時には表示がされずQualificationManagerBean not boundとエラーメッセージが表示されてしまいます。どのようにしたら、きちんと表示されるでしょうか?
struts-config.xmlには <!-- Process a Qualification --> <action path="/QualificationSearch" type="com.ihi.web.struts.actions.QualificationSearchAction"> <forward name="success" path="/qualification_search.jsp"/> </action> と表記しweb.xmlにも <!-- Action Servlet Mapping --> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> と表記しqualification_search.jspのところにも <html:form action="/QualificationSearch">と表記してあるのですが。。。 何が、原因か教えてもらいたいです。お願いします。 また、.doで表示されている画面もjspに書き換えると org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in scope null といったエラーが出てきちんと表示されません。 こちらの方も、お分かりの方がおりましたらお願いします。 | ||||||||||||
|
投稿日時: 2004-03-18 22:22
質問の内容がちょっと理解しづらいのですが、もし、QualificationSearch.do
として QualificationManagerBean not bound というエラーが出るのでしたら、
から、 com.ihi.web.struts.actions.QualificationSearchAction でエラーとなっていると思われます。この中で QualificationManagerBean を使っていますか? もしくは
にフォワードされてからのエラーであれば、この qualification_search.jsp 内で QualificationManagerBean を使っていますか? そこら辺のソースが無いことにはこれ以上分かりません。
まったく無意味です。そもそもパスが違うからjspファイルが見つからないと エラーになるはずです。そうならずに jspのファイルが見つかってしまって いますから、strutsの実装方法というか、jar や jsp などのファイルの格 納場所がむちゃくちゃであると思われます。 | ||||||||||||
|
投稿日時: 2004-03-19 10:47
回答、ありがとうございます。
質問のしかたが悪かったようで、すい、ません。 2つめの質問は、HTMLでかいたソース<input name="test1" type="text">を <html:text property="test1" size="10"/>と書き換えると、先日書きました org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in scope null とエラーが出てしまうのですが。 あと、1つ目の質問のQualificationSearchActionのソースは package com.ihi.web.struts.actions; import java.io.IOException; //import java.rmi.RemoteException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; //import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; //import com.ihi.common.dto.QualificationSearchDTO; import com.ihi.common.util.AppException; //import com.ihi.common.util.Debug; import com.ihi.services.delegate.QualificationManagerDelegate; import com.ihi.web.struts.forms.QualificationSearchForm; import com.ihi.web.util.WebConstants; import com.ihi.web.util.WebKeys; public class QualificationSearchAction extends Action{ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ActionErrors errors = new ActionErrors(); HttpSession session = request.getSession(); ArrayList arr = new ArrayList(); QualificationManagerDelegate delegate = new QualificationManagerDelegate(); QualificationSearchForm frm = (QualificationSearchForm)form; try { arr = delegate.getList(frm.getQualificationSearchDTO()); } catch (AppException e) { e.printStackTrace(); } session.setAttribute(WebKeys.SELECT_USER_SEX,arr); return (mapping.findForward(WebConstants.FORWARD_SUCCESS)); } } でqualification_search.jspは <%@ page contentType="text/html; charset=Shift_JIS" %> <%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %> <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" href="css/style_common.css" type="text/css"> <link rel="stylesheet" href="css/style_table.css" type="text/css"> <link rel="stylesheet" href="css/style_div.css" type="text/css"> <link rel="stylesheet" href="css/style_span.css" type="text/css"> <link rel="stylesheet" href="css/style_button.css" type="text/css"> <link rel="stylesheet" href="css/style_button2.css" type="text/css"> <link rel="stylesheet" href="css/style_link.css" type="text/css"> <link rel="stylesheet" href="css/style_detail.css" type="text/css"> <link rel="stylesheet" href="css/style_font.css" type="text/css"> <link rel="stylesheet" href="css/style_img.css" type="text/css"> <link rel="stylesheet" href="css/style_input.css" type="text/css"> <script type="text/javascript" src="javascript/jsLib_window.js"></script> <script type="text/javascript" src="javascript/jsLib_input.js"></script> <script type="text/javascript" src="javascript/jsLib_keyBoard.js"></script> <script type="text/javascript" src="javascript/util.js"></script> <title>テスト</title> <script type="text/javascript"> <!-- /* 画面ロード処理 */ function doOnload() { // サイズを設定 var width = 1024; //モニタの表示可能な横幅 var height = 750; //モニタの表示可能な高さ //画面の左上からの表示 window_windowMoveTo(0,0); //画面のサイズ window_windowResizeTo(width, height); //画面にフォーカス window.focus(); } /* 画面アンロード処理 */ function doUnload() { //画面配下のウィンドウ(子、孫、ヘルプ)を閉じる window_childrenWindowClose(); } /* ファンクションキー無効化処理 */ document.onkeydown = keyBoard_invalidFunctionKey; /* エンターキー無効化処理 */ document.onkeypress=enterkey; function enterkey(){ if(13==window.event.keyCode){ gotoLogin(); return false; } } //--> </script> </head> <body> <tr><br></tr> <tr><br></tr> <tr><br></tr> <fieldset> <legend align="left"><font size="3">テスト</font></legend> <tr><br></tr> <tr><br></tr> <table width="99%" border="1"> <tr> <td width="141" height="30"> <div align="center">賃料総額</div></td> <td colspan="5"><input name="textfield6934" type="text"> 円 〜 <input name="textfield6234" type="text"> 円 <div align="center"></div></td> </tr> </table> </fieldset> </body> </HTML> です。 長々とすいません。 | ||||||||||||
|
投稿日時: 2004-03-19 13:04
私もさっぱり状況が理解できない一人です。 エラーはどこで発生しているのですか?アクション?JSP? あと、動作する最小構成を作って(Struts のサンプル等)、そこから徐々に 今の形に近づけていく、という方法で問題の切り分けをやってみてはどうでしょうか。 ・[code]タグを使っていない ・コメントアウトされた部分も含む ようなソースがだらだら転記されていても読む気にはなれません。 | ||||||||||||
|
投稿日時: 2004-03-19 20:14
jspの方で QualificationManagerBean は使ってないですね。
Action の方からだと思うのですが、そもそもあなたがどこで QualificationManagerBean を使っているのでしょう? もし自分で分からなければ、とりあえずその動いているであろうAction をトレースしていくしかないですね。 | ||||||||||||
|
投稿日時: 2004-03-19 20:24
便乗質問です。
すいません。私も知らないんですが、ここで使えるタグの一覧とか どこで見れるんでしょう? | ||||||||||||
|
投稿日時: 2004-03-19 20:31
返信画面の入力欄の直下にある、 「この投稿でBBコードを使わない」 の BBコードのところのリンクをクリックすれば説明が出てきます。 | ||||||||||||
|
投稿日時: 2004-03-19 20:32
投稿を表示しているページの上に [FAQ] があります。 そこに使用法が書いてありますよ。 | ||||||||||||
