Steve? Do I really need all this code if I don't use insertRow()?
protected void initializeBindingsForPage(DataActionContext ctx)
System.out.println("***** initializeBindingsForPage - Start ***** ");
HttpServletRequest request = ctx.getHttpServletRequest();
String strCallingEvent = request.getParameter("event");
if (strCallingEvent != null )
System.out.println("event=" + strCallingEvent );
if ( strCallingEvent.equalsIgnoreCase("MYCREATE"))
System.out.println("---retrieving defaults for empno, report_year");
// Find parent values to seed this row.
Number numEmpno = null;
String strReportYear = null;
BindingContext bctx = ctx.getBindingContext();
Row r = bctx.findBindingContainer("browseEmpReportsDueUIModel")
.findIteratorBinding("ViewEmpReportsDueView1Iterator")
.getCurrentRow();
numEmpno = (Number) r.getAttribute("Empno");
strReportYear = (String) r.getAttribute("ReportYear");
System.out.println("numEmpno=" + numEmpno );
System.out.println("strReportYear=" + strReportYear );
// look for empno/reportyear
DCBindingContainer bc = ctx.getBindingContainer();
DCIteratorBinding iter = bc.findIteratorBinding("EmpReportView1Iterator");
System.out.println("---looking for existing row with this empno, report_year");
try
String strKey = null;
NameValuePairs keyValues = new NameValuePairs();
keyValues.setAttribute("Empno", numEmpno );
keyValues.setAttribute("ReportYear", strReportYear);
Key k = iter.getRowSetIterator().createKey( keyValues );
strKey = k.toStringFormat(true);
// Find the row in the associated row iterator based on the Key
// object and if found set that as the current row.
iter.setCurrentRowWithKey( strKey );
// can we exit this method if we found it? yes!
return;
catch (RowNotFoundException rex )
System.out.println( rex.getMessage() );
// ignore - we'll create it.
RowSetIterator rsIter = iter.getRowSetIterator();
System.out.println("rsIter.isRangeAtTop()="+rsIter.isRangeAtTop());
System.out.println("rsIter.isRangeAtBottom()="+rsIter.isRangeAtBottom());
System.out.println("rsIter.getCurrentRowSlot()="+
slotName( rsIter.getCurrentRowSlot() ) );
Row newRow = rsIter.createRow();
System.out.println("rsIter.isRangeAtTop()="+rsIter.isRangeAtTop());
System.out.println("rsIter.isRangeAtBottom()="+rsIter.isRangeAtBottom());
System.out.println("rsIter.getCurrentRowSlot()="+
slotName( rsIter.getCurrentRowSlot() ) );
if ( newRow != null )
System.out.println("after Create action invoke, stting attributes");
newRow.setAttribute("Empno", numEmpno );
newRow.setAttribute("ReportYear", strReportYear);
newRow.setNewRowState(Row.STATUS_INITIALIZED);
// rsIter.setCurrentRow( newRow );
// this doesn't make it current
// Another navigation attempt - fails!
// iter.getViewObject().setCurrentRow( newRow );
// Moves the currency to the slot before the first row.
// did not appear to show 1st record on 1st pass! Can we not move
// to this row??
// rsIter.reset();
// NOTE: If this code is NOT run, then your data entry screen only
// ever displays the first row, though the multi-record grid at
// bottom shows ALL rows!
Row tmpRow = rsIter.first();
if (tmpRow != null)
EmpReportViewRow empRow = (EmpReportViewRow) tmpRow;
System.out.println( "rowFound, Empno=" + empRow.getEmpno()
+ ",Report_Year=" + empRow.getReportYear() );
while ( rsIter.hasNext() )
empRow = (EmpReportViewRow) rsIter.next();
System.out.println( "rowFound, Empno=" + empRow.getEmpno()
+ ",Report_Year=" + empRow.getReportYear() );
} // iterator other rows
} // found the row
// End of moving to row just added - why are we doing this??
Row thisRow = iter.getCurrentRow();
if ( thisRow != null )
System.out.println("thisRow[\"Empno\"]=" +
thisRow.getAttribute("Empno"));
System.out.println("thisRow[\"ReportYear\"]=" +
thisRow.getAttribute("ReportYear"));
else
System.out.println("getCurrentrow() after setting defaults not found");
} // newRow != null
else
System.out.println("getCurrentRow() did not return a row!");
} // MYCREATE CALLED THIS
System.out.println("***** initializeBindingsForPage - End ***** ");
} // initializeBindingsForPage
I notice that Validifier turns the code into "Strict" HTML.
No it doesn't. It turns <embed> code (which was never sanctioned by the W3C) into VALID XHTML <object> code. Valid code passes W3C validation tests on either Strict or Transitional XHTML document types.
Shorter code is nice, but I like my W3C compliance. That's why I collapse code on scripts, forms, and embeds.
Huh? What? Collapse is a DW code view option only. It has no effect on published code.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com
Similar Messages
-
Hi, I hope this question won't seem too basic but if I want to use a new larger external drive for my time machine backups, will it do a new full backup the first time I plug it in and if so, do I really need all the old backups on my smaller external drive?
50maz wrote:
Hi, I hope this question won't seem too basic but if I want to use a new larger external drive for my time machine backups, will it do a new full backup the first time I plug it in
Yes, it will do a full backup.
and if so, do I really need all the old backups on my smaller external drive?
Only if you want to be able to go back in time to those previous Time Machine backups. When you plug in the new larger external drive, you will only be able to go back as far as the first day you plugged it in and ran the first Time Machine backup on it. -
i am a college student and really need a guest code if possible please
Welcome to the forum. A MAC is not technically necessary but it does help the transfer process, and the losing ISP might levy a charge if you go ahead without asking for one.
There's definitive advice here. If you click the question "How do I switch broadband suppliers?" you will find that a MAC must be provided within 5 days of a request. Phone TalkTalk again and shout at them if necessary.
You can click the white star next to this message if you think it was helpful. -
Need all transaction codes for idocs
need all transaction codes for idocs
Hi,
ALE IDOC
Sending System(Outbound ALE Process)
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Create Model View
Tcode BD82 ? Generate partner Profiles & Create Ports
Tcode BD64 ? Distribute the Model view
Message Type MATMAS
Tcode BD10 ? Send Material Data
Tcode WE05 ? Idoc List for watching any Errors
Receiving System(Inbound ALE )
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 ? Idoc List for inbound status codes
ALE IDOC Steps
Sending System(Outbound ALE Process)
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Create Model View
Tcode BD82 !V Generate partner Profiles & Create Ports
Tcode BD64 !V Distribute the Model view
This is Receiving system Settings
Receiving System(Inbound ALE )
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 !V Idoc List for inbound status codes
Message Type MATMAS
Tcode BD10 !V Send Material Data
Tcode WE05 !V Idoc List for watching any Errors
1)a Goto Tcode SALE
Click on Sending & Receiving Systems-->Select Logical Systems
Here Define Logical Systems---> Click on Execute Button
go for new entries
1) System Name : ERP000
Description : Sending System
2) System Name : ERP800
Description : Receiving System
press Enter & Save
it will ask Request
if you want new request create new Request orpress continue for transfering the objects
B) goto Tcode SALE
Select Assign Client to Logical Systems-->Execute
000--> Double click on this
Give the following Information
Client : ERP 000
City :
Logical System
Currency
Client role
Save this Data
Step 2) For RFC Creation
Goto Tcode SM59-->Select R/3 Connects
Click on Create Button
RFC Destination Name should be same as partner's logical system name and case sensitive to create the ports automatically while generating the partner profiles
give the information for required fields
RFC Destination : ERP800
Connection type: 3
Description
Target Host : ERP000
System No:000
lan : EN
Client : 800
User : Login User Name
Password:
save this & Test it & RemortLogin
3)
Goto Tcode BD64 -- click on Change mode button
click on create moduleview
short text : xxxxxxxxxxxxxx
Technical Neme : MODEL_ALV
save this & Press ok
select your just created modelview Name :'MODEL_ALV'.
goto add message type
Model Name : MODEL_ALV
sender : ERP000
Receiver : ERP800
Message type :MATMAS
save & Press Enter
4) Goto Tcode BD82
Give Model View : MODEL_ALV
Partner system : ERP800
execute this by press F8 Button
it will gives you sending system port No :A000000015(Like)
5) Goto Tcode BD64
seelct the modelview
goto >edit>modelview-->distribute
press ok & Press enter
6)goto Tcode : BD10 for Material sending
Material : mat_001
Message Type : MATMAS
Logical System : ERP800
and Execute
7)goto Tcode : BD11 for Material Receiving
Material : mat_001
Message Type : MATMAS
and Execute --> 1 request idoc created for message type Matmas
press enter
Here Master Idoc set for Messge type MATMAS-->press Enter
1 Communication Idoc generated for Message Type
this is your IDOC
Change Pointers
I know how to change the description of a material using ALE Change Pointers.
I will give the following few steps
1) Tcode BD61---> check the change pointers activated check box
save and goback.
2) Tcode BD50---> check the MATMAS check box save and comeback.
3) Tcode BD51---> goto IDOC_INPUT_MATMAS01 select the checkbox save and comeback.
4) Tcode BD52---> give message type : matmas press ok button.
select all what ever you want and delete remaining fields.
save & come back.
5) 5) go to Tcode MM02 select one material and try to change the description and save it
it will effects the target systems material desciption will also changes
6) goto Tcode SE38 give program Name is : RBDMIDOC and Execute
give Message type : MATMAS and Executte
ALE/IDOC Status Codes/Messages
01 Error --> Idoc Added
30 Error --> Idoc ready for dispatch(ALE Service)
then goto SE38 --> Execute the Program RBDMIDOC
29 Error --> ALE Service Layer
then goto SE38 --> Execute the Program RSEOUT00
03 Error --> Data Passed to Port ok
then goto SE38 --> Execute the Program RBDMOIND
12 Error --> Dispatch ok
Inbound Status Codes
50 Error --> It will go for ALE Service Layer
56 Error --> Idoc with Errors added
51 Error --> Application Document not posted
65 Error --> Error in ALE Service Layer
for 51 or 56 Errors do the following steps
goto WE19 > give the IDOC Number and Execute>
Press on Inbound function Module
for 65 Error --> goto SE38 --> Execute the Program RBDAPP01 then your getting 51 Error
BAPI tcode --- BAPI.
Also:
IDOC:
IDOC ADMINISTRATION
WE09 / WE02 IDoc lists according to content. View IDocs via specific IDoc number or business application detail contained within the contents of a segment.
WE05 View IDocs
WE60 IDoc type documentation tool
WE20 Partner profile configuration. Add partner detail together with inbound and outbound relationships. We also incorporate message control on the outbound IDocs. Utilize the organizational units to trap functional errors for further processing.
BD87 Reprocess IDocs in error or waiting for action. (Both inbound and outbound in 4.6. Use BD88 in prior versions)
1.4 IDOC DEVELOPMENT
BD55 Conversion rule user exit. Link conversion rule user exit to the different system \ partner combinations.
WE19 EDI test tool. Use to test inbound Function module changes.
WE31 Segment create
WE30 Create IDoc extension type
WE82 Link Release detail to Extension IDoc Type
WE57 Assign function module to logical message and IDoc type
BAPI: BAPI, SWO1.
Transaction codes Related for IDOC Configurations
WEDI: Area Menu for IDOCs
WE02: Display IDoc
WE19: ALE Test tool
WE30: Development of IDOC Type
WE31: Development of IDOC Segment
WE41: Process Codes, Outbound
WE42: Process Codes, Inbound
WE47: Status Maintenance
WE81: Logical Message Types
WE57: Assignment Messages for Appl. Objs
SM59: RFC Destinations (Display/Maintain)
SALE: Display ALE Customizing
BD54: Maintaining Logical Systems
BD67: Maintain methods (inbound)
BD64: Maintenance of Distribution Model
BD87: Status Monitor for ALE Messages
Reward points if found helpful...
Cheers,
Chandra Sekhar. -
Need all transaction codes related to SD and MM
hi
i am in need of need all transaction codes related to SD and MM.
can anyone help me to get it.
thanks in advance.Hi,
The most frequently used transaction codes are as follows:
1. VS00 - Master data
2. VC00 - Sales Support
3. VA00 - Sales
4. VL00 - Shipping
5. VT00 - Transportation
6. VF00 - Billing
Others as follows:
At Configuration:
1. VOV8 - Define Sales documents type (header)
2. OVAZ - Assigning Sales area to sales documents type
3. OVAU - Order reasons
4. VOV4 - Assign Item categoreies(Item cat determination)
5. VOV6 - Scedule line categories
6. OVAL - To assign blocks to relevant sales documents type
7. OVLK - Define delivery types
8. V/06 - Pricing
9. V/08 - Maintain pricing procedure
10.OVKP - Pricing proc determination
11.V/07 - Access sequence
Enduser:
1. Customer Master Creation-VD01 and XD01 (for full inclu company code)
VD02 - Change Customer
VD03 - Display Customer
VD04 - Customer Account Changes
VD06 - Flag for Deletion Customer
XD01 - Create Customer
XD02 - Modify Customer
XD03 - Display Customer
2. Create Other material -
MM00
3. VB11- To create material determination condition record
4. CO09- Material availability Overview
5. VL01 - Create outbound delivery with ref sales order
6. VL04 - Collective processing of delivery
7. VA11 - Create Inquiry
VA12 - Change Inquiry
VA13 - Display Inquiry
Sales & Distribution
Sales order / Quote / Sched Agreement / Contract
· VA01 - Create Order
· VA02 - Change Order
· VA03 - Display Order
· VA02 - Sales order change
· VA05 - List of sales orders
· VA32 - Scheduling agreement change
· VA42 - Contract change
· VA21 - Create Quotation
· VA22 - Change Quotation
· VA23 - Display Quotation
Billing
· VF02 - Change billing document
· VF11 - Cancel Billing document
· VF04 - Billing due list
· FBL5N - Display Customer invoices by line
· FBL1N - Display Vendor invoices by line
Delivery
· VL02N - Change delivery document
· VL04 - Delivery due list
· VKM5 - List of deliveries
· VL06G - List of outbound deliveries for goods issue
· VL06P - List of outbound deliveries for picking
· VL09 - Cancel goods issue
· VT02N - Change shipment
· VT70 - Output for shipments
General
· VKM3, VKM4 - List of sales documents
· VKM1 - List of blocked SD documents
· VD52 - Material Determination
MM Transaction Code
All transaction are stored in table TSTC.
Transaction for MM module start with M.
IH09 - Display Material
MM01 - Create Material
MM02 - Change Material
MM03 - Display Material
MM50 - List Extendable Materials
MMBE - Stock Overview
MMI1 - Create Operating Supplies
MMN1 - Create Non-Stock Material
MMS1 - Create Service
MMU1 - Create Non-Valuated Material
ME51N - Create Purchase Requisition
ME52N - Change Purchase Requisition
ME53N - Display Purchase Requisition
ME5A - Purchase Requisitions: List Display
ME5J - Purchase Requisitions for Project
ME5K - Requisitions by Account Assignment
MELB - Purch. Transactions by Tracking No.
ME56 - Assign Source to Purch. Requisition
ME57 - Assign and Process Requisitions
ME58 - Ordering: Assigned Requisitions
ME59 - Automatic Generation of POs
ME54 - Release Purchase Requisition
ME55 - Collective Release of Purchase Reqs.
ME5F - Release Reminder: Purch. Requisition
MB21 - Create Reservation
MB22 - Change Reservation
MB23 - Display Reservation
MB24 - Reservations by Material
MB25 - Reservations by Account Assignment
MB1C - Other Goods Receipts
MB90 - Output Processing for Mat. Documents
MB21 - Create Reservation
MB22 - Change Reservation
MB23 - Display Reservation
MB24 - Reservations by Material
MB25 - Reservations by Account Assignment
MBRL - Return Delivery per Mat. Document
MB1C - Other Goods Receipts
MB90 - Output Processing for Mat. Documents
MB1B - Transfer Posting
MIBC - ABC Analysis for Cycle Counting
MI01 - Create Physical Inventory Document
MI02 - Change Physical Inventory Document
MI03 - Display Physical Inventory Document
MI31 - Batch Input: Create Phys. Inv. Doc.
MI32 - Batch Input: Block Material
MI33 - Batch Input: Freeze Book Inv.Balance
MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
MIQ1 - Batch Input: PhInvDoc. Project Stock
MI01 - Create Physical Inventory Document
MI02 - Change Physical Inventory Document
MI03 - Display Physical Inventory Document
MI31 - Batch Input: Create Phys. Inv. Doc.
MI32 - Batch Input: Block Material
MI33 - Batch Input: Freeze Book Inv.Balance
MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
MIQ1 - Batch Input: PhInvDoc. Project Stock
MI01 - Create Physical Inventory Document
MI02 - Change Physical Inventory Document
MI03 - Display Physical Inventory Document
MI31 - Batch Input: Create Phys. Inv. Doc.
MI32 - Batch Input: Block Material
MI33 - Batch Input: Freeze Book Inv.Balance
MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
MIQ1 - Batch Input: PhInvDoc. Project Stock
MI21 - Print physical inventory document
MI04 - Enter Inventory Count with Document
MI05 - Change Inventory Count
MI06 - Display Inventory Count
MI09 - Enter Inventory Count w/o Document
MI34 - Batch Input: Enter Count
MI35 - Batch Input: Post Zero Stock Balance
MI38 - Batch Input: Count and Differences
MI39 - Batch Input: Document and Count
MI40 - Batch Input: Doc., Count and Diff.
MI08 - Create List of Differences with Doc.
MI10 - Create List of Differences w/o Doc.
MI20 - Print List of Differences
MI11 - Physical Inventory Document Recount
MI07 - Process List of Differences
MI37 - Batch Input: Post Differences
CT01 - Create Characteristic
CT02 - Change Characteristic
CT03 - Display Characteristic
CL01 - Create Class
CL02 - Classes
CL03 - Display Class
CL04 - Delete Class
CL2B - Class Types
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 7, 2008 12:53 PM -
Hi guys, I need help in debugging this code I made, which is a GUI minesweeper. Its extremely buggy...I particularly need help fixing the actionListener part of the code as everytime I press a button on the GUI, an exception occurs.
help please!
package minesweeperGUI;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MinesweeperGUI implements ActionListener
//Declaration of attributes
static int length = 0;
JMenuItem menuItemNew = new JMenuItem();
JRadioButtonMenuItem rbEasy = new JRadioButtonMenuItem();
JRadioButtonMenuItem rbHard = new JRadioButtonMenuItem();
JMenuItem menuItemExit = new JMenuItem();
JButton buttonReset = new JButton();
JButton buttonGrid[][] = null;
JFrame frame = new JFrame();
int getBombsTotal = 0;
JLabel setBombsLabel = new JLabel();
int a = 0;
int b = 0;
//No constructor created. Uses default constructor
//Create the menu bar
public JMenuBar newMenuBar()
//Sets up the menubar
JMenuBar menuBar = new JMenuBar();
//Sets up the Game menu with choice of new, grid size, and exit
JMenu menu = new JMenu ("Game");
menuBar.add (menu);
menuItemNew = new JMenuItem ("New");
menuItemNew.addActionListener (this);
menu.add (menuItemNew);
menu.addSeparator();
//Sets up sub-menu for grid size with choice of easy and hard radio buttons
JMenu subMenu = new JMenu ("Grid Size");
rbEasy = new JRadioButtonMenuItem ("Easy: 5x5 grid");
rbEasy.addActionListener (this);
subMenu.add (rbEasy);
rbHard = new JRadioButtonMenuItem ("Hard: 10x10 grid");
rbHard.addActionListener (this);
subMenu.add (rbHard);
menu.add (subMenu);
menu.addSeparator();
menuItemExit = new JMenuItem ("Exit");
menuItemExit.addActionListener (this);
menu.add (menuItemExit);
return menuBar;
//Setting up of Bomb Grid
public int [][] setGrid (int length)
int grid[][] = null;
grid = new int[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
grid[i][j] = ((int)Math.round(Math.random() * 10))% 2;
return grid;
//Setting up of the of the graphical bomb grid
public JButton[][] setButtonGrid (int length)
JButton buttonGrid[][] = null;
buttonGrid = new JButton[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
buttonGrid[i][j] = new JButton();
return buttonGrid;
//Setting up of a way to count the total number of bombs in the bomb grid
public int getBombsTotal (int length, int setGrid[][])
int bombsTotal = 0;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (setGrid[i][j] == 1)
bombsTotal += 1;
return bombsTotal;
//Create a label for number of bombs left
public JLabel setBombsLabel (int getBombsTotal)
JLabel bombsLabel = new JLabel(String.valueOf (getBombsTotal) + " Bombs Left");
return bombsLabel;
//Setting up a way to count the number of bombs around a button
public String setBombs (int length, int setGrid[][], int x, int y)
int bombs[][] = new int[length][length];
String bombsString = null;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (i == 0 && j == 0)
bombs[i][j] = setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i ==0 && j == (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else if (i == (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1];
else if (i == (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1];
else if (i == 0 && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i][j+1] +
setGrid[i+1][j-1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i == (length - 1) && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1];
else if (i != 0 && i != (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i != 0 && i != (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1] + setGrid[i+1][j-1] +
setGrid[i+1][j] + setGrid[i+1][j+1];
bombsString = String.valueOf (bombs[x][y]);
return bombsString;
//create the panel for the bombs label and reset button
public JPanel newTopPanel(int length)
int setGridNew [][] = null;
setGridNew = new int[length][length];
int getBombsTotalNew = 0;
JLabel setBombsLabelNew = new JLabel();
setGridNew = setGrid (length);
getBombsTotalNew = getBombsTotal (length, setGridNew);
setBombsLabelNew = setBombsLabel (getBombsTotalNew);
JPanel topPanel = new JPanel ();
topPanel.setLayout (new BorderLayout (50,50));
JLabel bombsLabel = new JLabel ();
bombsLabel = setBombsLabelNew;
topPanel.add (bombsLabel, BorderLayout.WEST);
buttonReset = new JButton("Reset");
buttonReset.addActionListener (this);
topPanel.add (buttonReset, BorderLayout.CENTER);
return topPanel;
//create the panel for the play grids
public JPanel newBottomPanel(int length)
JButton setButtonGridNew[][] = null;
setButtonGridNew = new JButton [length][length];
setButtonGridNew = setButtonGrid (length);
JPanel bottomPanel = new JPanel ();
bottomPanel.setLayout (new GridLayout (length, length));
buttonGrid = new JButton[length][length];
for (a = 0; a < length; a++)
for (b = 0; b < length; b++)
buttonGrid[a] = setButtonGridNew[a][b];
buttonGrid[a][b].addActionListener (this);
bottomPanel.add (buttonGrid[a][b]);
return bottomPanel;
//Overiding of abstract method actionPerformed
public void actionPerformed(ActionEvent e)
if (e.getSource() == menuItemNew)
launchFrame(length);
else if (e.getSource() == menuItemExit)
frame.setVisible (false);
System.exit(0);
else if (e.getSource() == rbEasy)
length = 5;
launchFrame(length);
else if (e.getSource() == rbHard)
length = 10;
launchFrame(length);
else if (e.getSource() == buttonReset)
launchFrame(length);
else if (e.getSource() == buttonGrid[a][b])
int setGridNew [][] = null;
setGridNew = new int[length][length];
JButton bombButton [][] = null;
bombButton = new JButton [length][length];
String bombString [][] = null;
bombString = new String[length][length];
setGridNew = setGrid (length);
bombString[a][b] = setBombs (length, setGridNew, a, b);
bombButton[a][b] = new JButton (bombString[a][b]);
if (setGridNew[a][b] == 0)
buttonGrid[a][b] = bombButton[a][b];
getBombsTotal--;
JLabel setBombsLabelNew = new JLabel();
setBombsLabelNew = setBombsLabel (getBombsTotal);
else if (setGridNew[a][b] == 1 )
buttonGrid[a][b] = new JButton("x");
JOptionPane.showMessageDialog (null, "Game Over. You hit a Bomb!");
System.exit(0);
//create the content pane
public Container newContentPane(int length)
JPanel topPanel = new JPanel();
JPanel bottomPanel = new JPanel();
topPanel = newTopPanel(length);
bottomPanel = newBottomPanel (length);
JPanel contentPane = new JPanel();
contentPane.setOpaque (true);
contentPane.setLayout (new BorderLayout(50,50));
contentPane.add (topPanel, BorderLayout.NORTH);
contentPane.add (bottomPanel, BorderLayout.CENTER);
return contentPane;
public void launchFrame (int length)
//Makes sure we have nice window decorations
JFrame.setDefaultLookAndFeelDecorated(true);
//Sets up the top-level window
frame = new JFrame ("Minesweeper");
//Exits program when the closed button is clicked
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
Container contentPane = new Container();
menuBar = newMenuBar();
contentPane = newContentPane (length);
//Sets up the menu bar and content pane
frame.setJMenuBar (menuBar);
frame.setContentPane (contentPane);
//Displays the window
frame.pack();
frame.setVisible (true);
public static void main (String args[])
//Default length is 5
length = 5;
MinesweeperGUI minesweeper = new MinesweeperGUI();
minesweeper.launchFrame(length);hi, thanks. that removed the exception; although now the buttons action listener won't work :(
here is the revised code:
To anyone out there, can you guys run this code and help me debug it?
I'm really desperate as this is a school project of mine and the deadline is 7 hours away. I have already been working on it for 3 days, but the program is still very buggy.
thanks!
/* Oliver Ian C. Wee 04-80112
* CS12 MHRU
* Machine Problem 2
package minesweeperGUI;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MinesweeperGUI implements ActionListener
//Declaration of attributes
static int length = 0;
JMenuItem menuItemNew = new JMenuItem();
JRadioButtonMenuItem rbEasy = new JRadioButtonMenuItem();
JRadioButtonMenuItem rbHard = new JRadioButtonMenuItem();
JMenuItem menuItemExit = new JMenuItem();
JButton buttonReset = new JButton();
JButton buttonGrid[][] = null;
JFrame frame = new JFrame();
int getBombsTotal = 0;
JLabel setBombsLabel = new JLabel();
int a = 0;
int b = 0;
//No constructor created. Uses default constructor
//Create the menu bar
public JMenuBar newMenuBar()
//Sets up the menubar
JMenuBar menuBar = new JMenuBar();
//Sets up the Game menu with choice of new, grid size, and exit
JMenu menu = new JMenu ("Game");
menuBar.add (menu);
menuItemNew = new JMenuItem ("New");
menuItemNew.addActionListener (this);
menu.add (menuItemNew);
menu.addSeparator();
//Sets up sub-menu for grid size with choice of easy and hard radio buttons
JMenu subMenu = new JMenu ("Grid Size");
ButtonGroup bg = new ButtonGroup();
rbEasy = new JRadioButtonMenuItem ("Easy: 5x5 grid");
bg.add (rbEasy);
rbEasy.addActionListener (this);
subMenu.add (rbEasy);
rbHard = new JRadioButtonMenuItem ("Hard: 10x10 grid");
bg.add (rbHard);
rbHard.addActionListener (this);
subMenu.add (rbHard);
menu.add (subMenu);
menu.addSeparator();
menuItemExit = new JMenuItem ("Exit");
menuItemExit.addActionListener (this);
menu.add (menuItemExit);
return menuBar;
//Setting up of Bomb Grid
public int [][] setGrid (int length)
int grid[][] = null;
grid = new int[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
grid[i][j] = ((int)Math.round(Math.random() * 10))% 2;
return grid;
//Setting up of the of the graphical bomb grid
public JButton[][] setButtonGrid (int length)
JButton buttonGrid[][] = null;
buttonGrid = new JButton[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
buttonGrid[i][j] = new JButton();
return buttonGrid;
//Setting up of a way to count the total number of bombs in the bomb grid
public int getBombsTotal (int length, int setGrid[][])
int bombsTotal = 0;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (setGrid[i][j] == 1)
bombsTotal += 1;
return bombsTotal;
//Create a label for number of bombs left
public JLabel setBombsLabel (int getBombsTotal)
JLabel bombsLabel = new JLabel(" " +String.valueOf (getBombsTotal) + " Bombs Left");
return bombsLabel;
//Setting up a way to count the number of bombs around a button
public String setBombs (int length, int setGrid[][], int x, int y)
int bombs[][] = new int[length][length];
String bombsString = null;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (i == 0 && j == 0)
bombs[i][j] = setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i ==0 && j == (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else if (i == (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1];
else if (i == (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1];
else if (i == 0 && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i][j+1] +
setGrid[i+1][j-1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i == (length - 1) && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1];
else if (i != 0 && i != (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i != 0 && i != (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1] + setGrid[i+1][j-1] +
setGrid[i+1][j] + setGrid[i+1][j+1];
bombsString = String.valueOf (bombs[x][y]);
return bombsString;
//create the panel for the bombs label and reset button
public JPanel newTopPanel(int length)
int setGridNew [][] = null;
setGridNew = new int[length][length];
int getBombsTotalNew = 0;
JLabel setBombsLabelNew = new JLabel();
setGridNew = setGrid (length);
getBombsTotalNew = getBombsTotal (length, setGridNew);
setBombsLabelNew = setBombsLabel (getBombsTotalNew);
JPanel topPanel = new JPanel ();
topPanel.setLayout (new BorderLayout (20,20));
JLabel bombsLabel = new JLabel ();
bombsLabel = setBombsLabelNew;
topPanel.add (bombsLabel, BorderLayout.WEST);
buttonReset = new JButton("Reset");
buttonReset.addActionListener (this);
topPanel.add (buttonReset, BorderLayout.CENTER);
return topPanel;
//create the panel for the play grids
public JPanel newBottomPanel(int length)
JButton setButtonGridNew[][] = null;
setButtonGridNew = new JButton [length][length];
setButtonGridNew = setButtonGrid (length);
JPanel bottomPanel = new JPanel ();
bottomPanel.setLayout (new GridLayout (length, length));
buttonGrid = new JButton[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
buttonGrid[i][j] = setButtonGridNew[i][j];
buttonGrid[i][j].addActionListener (this);
bottomPanel.add (buttonGrid[i][j]);
return bottomPanel;
//Overiding of abstract method actionPerformed
public void actionPerformed(ActionEvent e)
if (e.getSource() == menuItemNew)
closeFrame();
launchFrame(length);
else if (e.getSource() == menuItemExit)
frame.setVisible (false);
System.exit(0);
else if (e.getSource() == rbEasy)
closeFrame();
length = 5;
launchFrame(length);
else if (e.getSource() == rbHard)
closeFrame();
length = 10;
launchFrame(length);
else if (e.getSource() == buttonReset)
closeFrame();
launchFrame(length);
else if (e.getSource() == buttonGrid[a])
int setGridNew [][] = null;
setGridNew = new int[length][length];
JButton bombButton [][] = null;
bombButton = new JButton [length][length];
String bombString [][] = null;
bombString = new String[length][length];
setGridNew = setGrid (length);
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
bombString[i][j] = setBombs (length, setGridNew, i, j);
bombButton[i][j] = new JButton (bombString[i][j]);
if (setGridNew[a][b] == 0)
buttonGrid[a][b] = bombButton[a][b];
getBombsTotal--;
JLabel setBombsLabelNew = new JLabel();
setBombsLabelNew = setBombsLabel (" " String.valueOf (getBombsTotal) " Bombs Left");
else if (setGridNew[a][b] == 1 )
buttonGrid[a][b] = new JButton("x");
JOptionPane.showMessageDialog (null, "Game Over. You hit a Bomb!");
System.exit(0);
//create the content pane
public Container newContentPane(int length)
JPanel topPanel = new JPanel();
JPanel bottomPanel = new JPanel();
topPanel = newTopPanel(length);
bottomPanel = newBottomPanel (length);
JPanel contentPane = new JPanel();
contentPane.setOpaque (true);
contentPane.setLayout (new BorderLayout(5,5));
contentPane.add (topPanel, BorderLayout.NORTH);
contentPane.add (bottomPanel, BorderLayout.CENTER);
return contentPane;
public void closeFrame ()
frame = new JFrame ("Minesweeper");
frame.dispose();
public void launchFrame (int length)
//Makes sure we have nice window decorations
JFrame.setDefaultLookAndFeelDecorated(true);
//Sets up the top-level window
frame = new JFrame ("Minesweeper");
//Exits program when the closed button is clicked
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
Container contentPane = new Container();
menuBar = newMenuBar();
contentPane = newContentPane (length);
//Sets up the menu bar and content pane
frame.setJMenuBar (menuBar);
frame.setContentPane (contentPane);
//Displays the window
frame.pack();
frame.setVisible (true);
public static void main (String args[])
//Default length is 5
length = 5;
MinesweeperGUI minesweeper = new MinesweeperGUI();
minesweeper.launchFrame(length); -
TS3700 How do you solve this problem if you don't use an Apple headset?
Pushing the headset flush is useful advice if you use Apple's headset, which cannot be used for running. What do you do if you don't use an Apple headset, if the headset is flush, and if the iPod stops playing after two minutes?
Back from the gym.
Same behavior with the Apple earbuds. Turn music on; and music turns off within seconds. Wait. Then maybe screen suddenly lights up. Quick, press play! Oh, too late, it went dark again. Fuss with the device. Suddenly screen lights up. Press play. Music! A few seconds, then off. Arghhh. And this happens whether I run or whether I am lifting weights.
Then, for the last half hour, fine behavior. Double click goes to the next song. One click lights the screen on. One click lights the screen off. Running, walking, or stretching.
Net net, same erratic behavior as with the other headset. I made sure the Apple jack was fully inserted per the photo on another thread in this support community. The part where the iPod was working fine also explains why the genius at the store thought I was gaga when I claimed there was a problem.
Shuffle shake is off; double click on big button set to next song; all other options off. -
Assistance needed on this code, please
The code below is an example program:
/* package demo.swing; */
import javax.swing.JFrame;
* Hello World application
* @author MAbernethy
public class HelloWorld extends JFrame
private javax.swing.JLabel jLabel = null;
private javax.swing.JTextField jTextField = null;
private javax.swing.JButton jButton = null;
public static void main(String[] args)
HelloWorld w = new HelloWorld();
w.setVisible(true);
public HelloWorld()
super();
this.setSize(300, 200);
this.getContentPane().setLayout(null);
this.add(getJLabel(), null);
this.add(getJTextField(), null);
this.add(getJButton(), null);
this.setTitle("Hello World");
private javax.swing.JLabel getJLabel() {
if(jLabel == null) {
jLabel = new javax.swing.JLabel();
jLabel.setBounds(34, 49, 53, 18);
jLabel.setText("Name:");
return jLabel;
private javax.swing.JTextField getJTextField() {
if(jTextField == null) {
jTextField = new javax.swing.JTextField();
jTextField.setBounds(96, 49, 160, 20);
return jTextField;
private javax.swing.JButton getJButton() {
if(jButton == null) {
jButton = new javax.swing.JButton();
jButton.setBounds(103, 110, 71, 27);
jButton.setText("OK");
return jButton;
The code compiles without any probems,but when run the following error messsages appear:
Exception in thread "main" java.lang.Error: Donot use HelloWorld.add() use HelloWorld.getContentPane().add() instead
at javax.swing.Jframe.creatRootPaneException(Jframe.java:465)
at javax.swing.Jframe.addImpl(Jframe.java:491)
at java.awt.Container.add(Container.java:518)
at HelloWorld.<init>(HelloWorld.java:26)
at HelloWorld.main(HelloWorld.java:17)Donot use HelloWorld.add() use
HelloWorld.getContentPane().add() instead
Isn't that obvious enough?D'oh! That was pretty obvious... ;)Yup, but my comment was directed at the OP, and I wish he reads your answer and remembers it next time. :) -
& Include MZFBPS_TRREQTOP Module poo
PROGRAM SAPMZFBPS_TRREQ .
tables : ZFBPS_TRPTR_REQ,
ZFBPS_CONT_HD,
ZFBPS_CONT_DT.
data: OK_CODE like sy-ucomm,
save_ok(4).
data : it_gate like standard table of ZFBPS_TRPTR_REQ,
wa_gate like line of it_gate.
TYPES: BEGIN OF values,
TRANSPORTER_CODE TYPE ZFBPS_CONT_HD-TRANSPORTER_CODE,
TRUCK_CODE TYPE ZFBPS_CONT_DT-TRUCK_CODE,
DESTINATION TYPE ZFBPS_CONT_DT-DESTINATION,
END OF values.
DATA: TRANS(5) TYPE c,
TRUCK(15) TYPE c.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values,
values_tab TYPE TABLE OF values.
*& Module INIT OUTPUT
text
MODULE INIT OUTPUT.
progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'TRANS'.
APPEND field_value TO dynpro_values.
ENDMODULE. " INIT OUTPUT
*& Module VALUE_TRANS INPUT
text
MODULE VALUE_TRANS INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'ZFBPS_CONT_HD'
fieldname = 'TRANSPORTER_CODE'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TRANS'.
ENDMODULE. " VALUE_TRANS INPUT
*& Module VALUE_TRUCK INPUT
text
MODULE VALUE_TRUCK INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT ATRANSPORTER_CODE BTRUCK_CODE b~DESTINATION
FROM ( ZFBPS_CONT_DT AS B INNER JOIN ZFBPS_CONT_HD AS A
ON ACONTRACT_NUM EQ BCONTRACT_NUM )
INTO CORRESPONDING FIELDS OF TABLE values_tab
WHERE A~TRANSPORTER_CODE = field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TRUCK_CODE'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TRUCK'
value_org = 'S'
TABLES
value_tab = values_tab.
ENDMODULE. " VALUE_TRUCK INPUT
In values_tab I have three fields and I wish to return all the three fields,but at present I am able to return only one field (TRUCK). How to return other fields.
Please suggest a solution.
Regards,
Deepak.Do not pass the dynprofield parameter and check.
Regards,
Ravi -
I want to burn my imovie to a dvd. All the help info says to use idvd but I can't get it to open. The applecare guy said idvd is no longer included in new macs, so why are all the instructions still saying to use it? Is one of the other software offerings, like dvd Cfreator for Mac, ok to use for this? What's the best one?
Please clarify what you mean by "you can't get it to open". Is iDVD on your system or not? If this is a new iMac, iDVD is no longer bundled with new Macs, so the application just isn't there and hence of course can't be opened. You can still purchase it as part of the retail iLife '11 box, though, if you want it, and it would be less expensive than DVD Creator (which I have no experience with), even though you'll get some redundant applications.
Regards. -
I have a macbook pro, but the amount of pictures I have now exceeds 500GB
I want to have all the pictures in iPhoto, so I could see them and edit them in iPhoto.
Which means... I need the iPhoto file folder in an external HDD to use iPhoto that way.
Can i move the iPhoto folder onto an external HDD?
Will it work the same way, as if the iPhoto folder is on the internal drive?yes
yes
Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
LN -
I need my activation code.
I installed all my new boxes recently. I didn't know I needed to use the activation code and I think I sent it back with the old equipment.
Everything is working as expected, but I am still getting the nag screen on the VZ in home agent.
Can you please connect me to a way that I can retreive my activation code?
thanks
FuelishYou don't need an activation code for most things. What are you trying to do that seems to need one?
These forums are peer to peer, so if you really need an activation code you wil have to use the "contact Us" option that verizon has on all their web pages.
PS: the PC based In-home-agent is almost completely worthless. It has known bugs that will cause problems on PC's including going into a loop that will eat all CPU cycles for at least once processor. Web based and STB version will pretty much do everything you need in-home-ageent to do. -
Curious If All This PHP Code Is Necessary
PHP Newbie Question:
This attached code was made with DW CS3 php-msql server
behaviors - recordset pull down's....
I'm curious if all this code is necessary? Some of it seems
to make things harder to work with .... For example:
1 - why does DW decide to take GET['xVARx'] form variables
and convert them to $Vars? - why not just use the GET['xVARx'] ?
2 - Why do they use sprintf in the $query_test : rather than
something more direct like:
SELECT * FROM phonebook WHERE firstname LIKE
%$_GET['firstname']% and lastname LIKE %$_GET['lastname']% -
etc....
Just curious why they chose these methods... Any insight
would be appreciated....oO(revdave)
>PHP Newbie Question:
>
> This attached code was made with DW CS3 php-msql server
behaviors - recordset
>pull down's....
>
> I'm curious if all this code is necessary? Some of it
seems to make things
>harder to work with .... For example:
>
> 1 - why does DW decide to take GET['xVARx'] form
variables and convert them to
>$Vars? - why not just use the GET['xVARx'] ?
You can't rely on the existance of $_GET['xVARx']. You always
must test
with isset() if the URL parameter is set, before you can use
it or load
it into a local variable. If it doesn't exist, you have to
initialize
the variable with a default value. DW's code does this, so
you can then
safely use $xVARx - it will either contain the value from
$_GET['xVARx']
or a usable default.
> 2 - Why do they use sprintf in the $query_test : rather
than something more
>direct like:
>
> SELECT * FROM phonebook WHERE firstname LIKE
%$_GET['firstname']% and lastname
>LIKE %$_GET['lastname']% - etc....
Such code is much harder to read and maintain and more
error-prone
(watch the quotes for example). When you want to embed
multiple
variables into a string, using sprintf() is the more flexible
way.
You've also missed a little detail. DW doesn't directly use
the given
values in the string, but calls GetSQLValueString() on them
first.
Proper handling of user-submitted values is very important to
prevent
SQL injection. Your example above doesn't prevent this kind
of attack.
HTH
Micha -
How can i set a global error page for all error cod
how can i set a global error page for all error code?
i don't want to leave a long list in the web.xml file.could any one help me?
thanksIf u have a common Error JSP named as ErrorPage.jsp
You need to have the following piece of code in the JSP as :
<%@ page isErrorPage ="true"%>
This makes it as the Common Error Page for the Application. Now all you need to do is from other JSP's throw the Exception to teh container. The container will redirect to this Page and process accordingly.
Thanks and regards,
Pazhanikanthan. P -
what this code does ?
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");i am studying this code....
//Verify the hostname, check all trusted cetifcates and install them in the machine
com.sun.net.ssl.HostnameVerifier ver = new com.sun.net.ssl.HostnameVerifier(){
public boolean verify(String urlHostname,String certHostname)
try
{ return true;
} catch(Exception x){ return true; }
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[]{
new javax.net.ssl.X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
// Install the all-trusting trust manager
try {
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
sc=null;
} catch (Exception e) {
e.printStackTrace();
//Setting the defaultHost name verfier set by the user for communication
HttpsURLConnection.setDefaultHostnameVerifier(ver);/**/please note the bold colored code from the above i.e
HttpsURLConnection.setDefaultHostnameVerifier(ver);
so, ver instance has been presented to the setDefaultHostnameVerifier . fine....but who is calling the methods verify() which is described in the implemented Annoynymous interface HostnameVerifier .
who is calling that overridden method verify() ?
similarly, who is calling getAcceptedIssuers() method?
I DONT see any invocation of these overridden methods .
are these methods are FRAUD and BUGGY...and are not needed in this code....are they redundant ?
OR are these methods are invoked by the HttpsURLConnection internally somehow....
confused about the functionng of this code.
thanks for the time
Maybe you are looking for
-
Having trouble setting up Distributed Processing / Qmaster
Hey Guys, I was able to (at one point) use Compressor 3 via Final Cut Pro Studio with Qadministrator to allow Distributed processing either via managed clusters or QuickCluster - both worked on both macs (a 2007 2.6Ghz Core 2 Duo iMac and a 2009 3.06
-
The BPM Workspace is loading and failing to initialize the directory.xml
Hi BPM Specialists, I installed BPM along with SOA suit in Windows XP box. Now I am getting failing to initialize directory.xml error and the workspace is not getting loaded.I am not able to locate a directory.xml file in my installed directory. Plea
-
What is the VPN for Iphone 4s and do I need it?
Just trying to figure out if it's important?
-
Set default timezone to UTC in Flex?
Hello, is there any way of setting the local timezone of my Flex application to UTC? I am aware of all the UTC related functions in the Date class, so that's not what I am interested in. Cheers! Tom
-
Finding t-codes based on database field
Dear All, I have a field AUFK-KOSTL, I want to find in which transactions or transaction codes, this field is being used. Please let me know on which transactions the field AUFK-KOSTL is being used. Thanks in Advance, Ramana