0

このコードがありますが、次のメッセージが表示されます。

ブレーク文のある最初の行だけに到達できないコード

ここに私のコードの他の例:

public HTMLFile(Object... argv) {
  this.Name = (String)argv[0];
  switch( argv.length ) {
    case 6: //assigning the value 6th variable and follow with other variables
      this.StyleSheet = "<link rel=\"stylesheet\" href=\""+(String)argv[5]+"\" type=\"text/css\" />";
    case 5://assigning the value 5th variable and follow with other variables
      this.ShortCutIcon = "<link rel=\"shortcut icon\" href=\""+(String)argv[4]+"\" type=\"image/x-icon\" />";
    case 4:
      this.css = (CSS)argv[3];
    case 3:
      this.HtmlMeta = "<meta http-equiv=\"Content-Type\" content=\"text/html; "+this.CharSet[(Integer)argv[2]]+"\" />";
      this.HtmlTitle = "<title>"+(String)argv[1]+"</title>";
      break;
    case 2:
      this.HtmlTitle = "<title>"+(String)argv[1]+"</title>";
      this.HtmlMeta = "<meta http-equiv=\"Content-Type\" content=\"text/html; "+this.CharSet[0]+"\" />";
      break;
    case 1:
      this.HtmlTitle = "<title></title>";
      this.HtmlMeta = "<meta http-equiv=\"Content-Type\" content=\"text/html; "+this.CharSet[0]+"\" />";
      break;
   }
  this.ResetFile();
}

そしてエラー:

Ha tenido lugar un error en la línea: 76 en el archivo jsp: /WorkingDB/HTML.jsp
Unreachable code
73:         case 3:
74:           this.HtmlMeta = "<meta http-equiv=\"Content-Type\" content=\"text/html;     "+this.CharSet[(Integer)argv[2]]+"\" />";
75:           this.HtmlTitle = "<title>"+(String)argv[1]+"</title>";
76:           break;
77:         case 2:
78:           this.HtmlTitle = "<title>"+(String)argv[1]+"</title>";
79:           this.HtmlMeta = "<meta http-equiv=\"Content-Type\" content=\"text/html; "+this.CharSet[0]+"\" />";

実際のコードで同様のエラーが発生します:

HTMLForm(String Name, String Form, int Method, Object... argv) {
  this.Name = Name;
  this.Form = Form;
  this.Method = Method;
  switch( argv.length ) {
    case 1:
      this.css = (CSS)argv[0];
      break;
    case 2:
      this.css = (CSS)argv[0];
      this.Action = (String)argv[1];
      break;
  }
}

メッセージエラーが再び:

Ha tenido lugar un error en la línea: 825 en el archivo jsp: /WorkingDB/HTML.jsp
Unreachable code
822:       switch( argv.length ) {
823:         case 1:
824:           this.css = (CSS)argv[0];
825:           break;
826:         case 2:
827:           this.css = (CSS)argv[0];
828:           this.Action = (String)argv[1];

ばかげた質問かもしれませんが、私には間違いがわかりません。

C:\Users\PC>java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

C:\Users\PC>

Tomcat バージョン: Tomcat 7.0.19

4

0 に答える 0