1. user clicks the link in our app (www.app1.com) , cookie set up done (respose.addCookie)
2. request will redirect to (third party software, cant change anything)
3..Here if the SSO enabled, it will redirect to the another URL (www.issues.app1.com) .
4,Have to get the cookie(User details) set in #1 here and validate.
Its working fine .But if we change the www.app1.com to www.abc.com , SSO is not working. We cant change www.issues.app1.com.
How to share the cookie in cross domain across 3 apps ? because middle app , we dont have control over it.
String TO = "raj@gmail.com;ra@gmail.com;RS@yahoo.com"; String CC= "rajt@in.com;rht@basss.com";
My query is i want to extract domains from above two Strings and Store these domains in HashSet. How could i do this with minimum code and performance wise.
This is a design question is the same problem in any language.as you do to map the controller to the domain model?We have situations in general larger than ... consider the example objects .
situation.1 - We have a request that has all the parameters of the account ;{ " id" : " 1 " , "name " : "test " , "some " : " xxx " } ............. and other fields .
situation.2 - can request that has to have a certain account parameters , for example in the case of an update;{" id" , " 1" , "name " , " testUpdated "}
situation.3 - We have a request that has some parameters of the account , others have more like id as user together;{ " id" : " 1 " , "user " : " xxx " , "service " : " yyy " } in which case each piece of the request will turn an object .
Java Code:
public class Account {
private Long id; private String name ; private String some ;
} mh_sh_highlight_all('java');
I see a few options ;
1 - Can I get AccountForm in the controller and set the properties for the Account object and others in CONTROLLER ;
+ ok for situation.1 situations 2, and situation.3
+ Separates the requisition of the object domain
- Pollutes the controller with code conversion
- Controller is full of setters .. if a higher class as a large object as a request is very confusing .
Java Code:
controller ( AccountForm from ) { Account account = new Account ( ) account.setNome form.getNome = (); account.setSome form.getSome = (); Other outher = new Other ( ) ; other.setSome ( form.getSome ( ) ) ; } mh_sh_highlight_all('java');
2 - Can I get AccountRequest in the controller and have a method in itself as AccountRequest.getAccount ( ) to return a mapped model , in this case the mapping is at own Request object .
+ Separates the requisition of the object domain
+ Encapsulates the conversion in a place with easy access .
+ Meets situation.1 situation.2 and situation3 ;
- Request object has two responsibilities represent the request and map to a valid model .
4 - Outsource this mapping request parameters to another object mapper for request ..
+ Isolates logic mapping
- Until complexity for simpler cases are used as standard for all such a find by id .
- One more class for each request ;
In the case of API gets worse response has two further classes. speaking in terms of request for response .... AccountRequest, AccountRequestMapper, Account, AccountResponseMapper, AccountResponse .....I'm doing more testing the Hybrid option 3 for simple cases (find ID or updates) .... with option 2 for example for more complex cases ..
I've been unable to figure out how to access an objects data from another class. I ended up missing a lesson in java and haven't been able to catch up on this topic on my own through my textbook.
Error: has private access
Code:
public class TestCoffeeDrinker { public static void main(String[] args) { Coffee latte = new Coffee("Starbucks Tall Latte", 2.85); Coffee mocha = new Coffee("Starbucks Grande Mocha", 3.95); Coffee mcdonalds = new Coffee("McDonalds McCafe", 0.99); System.out.println(mcdonalds.toString());
I want to keep count of how many students are in my array. the array i made up of objects from other classes. like the class Student how do i do this. i have tried contains but better way it to to a loop to go through the array and determine if each object is a particular type but i don't know how to do this. here is the code
import java.util.*; import java.util.ArrayList; public class Driver { public static void main(String[] args){ /* Comments required PersonFileReader pfr = new PersonFileReader("person.dat"); ArrayList<Person> testData = pfr.readData(); Database db = new Database(testData);
I need my java program to insert data into my access database. I get no errors in my code, but it never inserts, deletes the data in my database. Here is my code:
import java.awt.*; import java.awt.event.*; import java.sql.*; public class INS extends Frame implements ActionListener{ Frame f; Label l1, l2; TextField t1, t2; Button b1, b2, b3, b4, b5; Connection c;
I have been asked to write a program with 3 classes(an interface, a store and a product class) and I have been going ok until I need to display data on the interface that is held in the product class. At the moment the code will compile fine but when I run the program and try to use the writeOutput() method I get a stack overflow error.
I realise now that it is because of a non-terminating recursive call, however I can not think of a solution on how to fix the problem. And just to clarify, what I am aiming to do is have the MatesTerminal class display the data for name that is stored in the Product class(I have no way of determining which product to display at this time, so I would like to be able to display the data for all three products if possible). Anyway this is what I have so far:
The method from the MatesTerminal Class:
private void writeOutput() { int productChoice; Scanner console = new Scanner(System.in);
I have a random access file stream. I have below code I want to written data that is currently pointed by pointer till the end and display that data on System.out Stream but it is not working my code is
//Create a Random Access File java.io.RandomAccessFile random=new java.io.RandomAccessFile("D:/input.txt","rw"); //Position the pointer to a seek try { random.seek(300); long pointer=random.getFilePointer(); System.out.println("Current Pointer is:"+pointer); int a; while((a=random.read())!=-1) { System.out.println(a); }
Where am I wrong? Although it is returning actual position of pointer in pointer using
I am creating a read/write, RandomAccessFile that I will use to store several student ID and gpa score. What I don't understand is how I should go about retrieving a particular set of data.
public class ReadWrite { static Scanner keyboard = new Scanner(System.in); static String fileName = "Stu.dat"; static RandomAccessFile raf; public static void main(String [] args) throws FileNotFoundException, IOException {
I have following methods, which I call from the Event Dispatcher Thread:
public void setTitle(String title) { Platform.runLater(() -> stage.setTitle(title));} public String getTitle() { return stage.getTitle(); // <- Access from outside JFX App Thread ok?}
Is it thread-safe, when the getter-Method just return the value like the example show? Or must I create a Runnable, so stage.getTitle() is called inside the Java Application Thread? How I return the value then?
I would like to know whether I should use properties and observable collections when creating a domain model for a new application using FX? I have read up quite a bit on the topic, but I can't find any clear answers. Most forums tend to suggest that the domain model should NOT contain properties, since this does not encourage a loose coupling of the model and the view. The alternative however is to write wrapper classes for each POJO in my domain model. This is however a lot of duplication, and it requires a complete listener system to ensure that the wrapper classes are in sync with the model classes.
I'm trying to write data for three products to a random access file, but I have a problem. Each product has a code and a price. After writing them to my file, I want to get to the second field or product. I do this by getting the length for each record, and multiplying it by the field number I want to go to. I use the result for the seek() method of the RandomAccessFile object. It is giving me an EOFException, but when I use 0 for the seek method i get the data for the first poduct or field.
Java Code:
public static void main(String[] args) { final int RECORD_LENGTH = 16; try(RandomAccessFile productsOutput = new RandomAccessFile("C:UsersalfonsoDesktopBinaryTestRandom.ran", "rw")) { String[] codes = {"java", "jsps", "txtp"}; double[] prices = {49.5, 19.9, 29.9}; for(int i = 0; i < codes.length; i++) {
I would like to understand how does multipart/form-data works during file upload scenario's, Does it chunks the data from client to server while transferring the files ?
I'am trying to converting string data into xml data using xml beans and StringEscapeUtils.This is work fine but in one case it if the data contains special characters.
Code snippet -------------------- import org.apache.commons.lang3.StringEscapeUtils; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; public class ParseXMLData { public static XmlObject parseXML(String stringXML) { XmlObject xmlObject = null;
[Code] ....
success case --------------------------- i/p------<aaa><bbb>This converts string to xml</bbb></aaa> o/p---<aaa><bbb>This converts string to xml</bbb></aaa>
Failer case ----------------- i/p----<aaa><bbb>This fails if it contains < symbols</bbb></aaa> expected o/p----<aaa><bbb>This fails if it contains < symbols</bbb></aaa>
Observed that it converts < to '<' but as per xml rules, if data contains '< ' it fails. I want to convert staring and end tags to xml format and if data in b/w middle of starting and ending tags do'n need to convert it. How to do it.
Is there a way to inform the Entity Manager or force the JPA provider to reload data from the database? The scenario could be data being updated by a store procedure or direct SQLPlus maintenance, without restarting the Application Server, the JPA need to load the newly updated data from the database.
I think the current JPA API is not enough. The void refresh(java.lang.Object entity) from EntityManager need to pass in the Entity object, I will like to know how to refresh the entire JPA Entity data after the physical table data being update from backend.
By using FileReader, FileWriter and their constituents, I am creating a file to contain employee information ( name, age, hours, etc. ). The user is to input all of the data on a single line and we were asked to implement StringTokenizer to assign that data to the file. I have never used the StringTokenizer before, but I have a rough idea how it is to function. I used pw.println to test what I have so far, now I would like to let the user build the initial file with the "first employees" of the company, and then view the file, and then go back and append new employee data to that same file. My question is, how can I take the user input as a StringTokenizer and add that to the file?
In the for loop below, I thought I would see if it would work, but it does not. The loop only executes once and does not allow me to enter data.
public class Records { public static void main(String [] args) throws IOException { Scanner input = new Scanner(System.in); FileWriter fw = new FileWriter("dbs3.java"); BufferedWriter bw = new BufferedWriter(fw); PrintWriter pw = new PrintWriter(bw); System.out.println("NEW EMPLOYEE DATA SHEET"); System.out.print("Number of new employees: "); int number = input.nextInt();
I am able to upload the file to the server, but I am not able to get the value of text1 in the servlet (I am getting null value of text1 in the servlet), I need this textfield in the form to submit some additional information while uploading it to the server.
--> Is enctype="multipart/form-data" option of form doesn't allow other form data to be submited? if it doesn't allow it then what are the other options I have to send this additional textfield to the server.
I have written several simple data classes that I serialized manually by converting to text. At this point I need to serialize a more complex data structure. which will include lists of the simpler elements. Can serialize store and reconstitute this type of structure automatically or do I need to do this one manually as well? Consider the pseudocode below for a clarification of my question;
Class Recipie{ String Name; CList HopList; CList MaltList; };
CList RecipieList; mh_sh_highlight_all('java');
I read the article on Serialization presented at tutorial point, but the example only showed a simple class, not lists of class members. What I want to do is serialize RecipieList, which consists of a CList of Recipies, which in turn consist of CLists of various ingredients.
I have a program which consist of several classes. The program reads a pom file and parses the data and then writes the data to a static table. The issue I'm having is with writing my LIB file data to my table. In the HtmlDataTable Class Im trying to write the files that are read in the lib directory to the table. My table currently consist of 3 columns (missing jar files,Lib Directory files, and POM file data) currently Im only able to write the missing jar files data to my table. In the HtmlDataTable class there is a for statement where I write the missing jar file data to my table. Im also trying to write the contents of the Lib directory within this statement as well. This is where I'm having my issue. My other classes consist of a SAX parser which parses the xml file, a class that creates my static table and a class that compares the jar files in my lib directory to the jar files in my pom file. . Theres a lot of code so I included the parts I felt were useful. If needed I can include the other classes as well.
public class ReadPomFile extends DefaultHandler { public static void main(String[] args) { try { // obtain a SAX based parser to parse XML document
I am creating a program where it reads the data inside a file and then places this data into arrays. The file I created has numbers 1-30 in it, file named, testing1.txt .
I am deploy my project in a machine and access it through VPN. In one page i am sending parameters array through hidden input field. When i access it in process page through request.getParameterValues it return null values, you can see it in attachment.This page work fine without VPN.