עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

java, source packages and web pages

Featured Replies

פורסם

שלום!

יש לי בעייה בעבודה שאני עושה בג'אוה:

כתבתי תוכנית (java application) ועכשיו אני צריך להעביר אותו לדף אינטרנט.

כאשר אני נמצא בקובץ JSP, אני קורא לפונקציה מה- source package שאמורה להחזיר לי ערך, אבל במקום אני מקבל exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /RunGame.jsp at line 62

שורה 62 זו השורה האחרונה שכתובה.

כל מה שהפונקציה עושה זה להפוך STRING לקורדינאטה. הפונקציה הזו עובדת כמו שצריך.


Player currPlayer = null, rivalPlayer = null;

//board = (Board) session.getAttribute("board");
p1 = (Player) session.getAttribute("p1");
p2 = (Player) session.getAttribute("p2");
currPlayer = (Player) session.getAttribute("currPlayer");
rivalPlayer = (Player) session.getAttribute ("rivalPlayer");
//locNextMove = (PossibleCube) session.getAttribute ("PC");
//loc = (Location) session.getAttribute ("loc");

String GameType = request.getParameter("GameType");
String name;
String msg = request.getParameter("msg");
Boolean hitLoc = (Boolean) session.getAttribute ("hitLoc");


int pointsToWin = 0;// = p1.board.sizeOfAllShips();
if (/*p1 == null ||*/ msg.compareTo("newGame") == 0)
{
name = request.getParameter("name");
if (name.compareTo("") == 0)
name = "player";
p1 = new HumanPlayer(name);
p2 = new ComputerPlayer ();

if (GameType.charAt(0) == 'U')
{
currPlayer = p1;
rivalPlayer = p2;
}
else
{
currPlayer = p2;
rivalPlayer = p1;
}

Location a = currPlayer.string2loc("5A");
	Player p1= null, p2 = null;

התוכנית עוד ארוכה, ולא נראה לי שצריך אותה. בפעם הראשונה שמגיעים ל- jsp הזה, מגיעים קודם לחלק הזה, ורק אח"כ לשאר התוכנית...

האם משהו יודע מה הבעיה? ניסיתי כל מיני וריאציות שונות וללא הצלחה.

תודה,

מושיקו

--------עריכה--------

בסופו של דבר מצאתי את הבעייה. טעות אנוש קטלנית (ומאוד טפשית) שעשיתי.

(אפשר לסגור)

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.