Java EE

17K

Solutions

9K

Contributors

Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.

Share tech news, updates, or what's on your mind.

Sign up to Post

i have one problem one dropdown is there for example dropdown having 2 values A and B
if i select A it works normally and go to the controller but if i select B one more dropdown
open in the same page . please help me out on this.
0
Python 3 Fundamentals
LVL 19
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

hi am having issue checking java home in linux
 java --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

i have this in my profile
export JAVA_HOME=/usr1/Oracle/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
0
i have button and a i-frame in my jsp page but i want to show that i-frame button while click on that button . when i click on button i-frame content should visible
else hide.
1
want to read a file line by line , each line want to store in string array and want also total no of lines

BufferedReader input = null;
            int numLines = 0;
            String[] lines = null;
            try {

                  input = new BufferedReader(new FileReader(lFilePathStr));
                  try {
                        String line = null;

                        while ((line = input.readLine()) != null) {
                              numLines++;
                        }
                        for(int count = 0; count < numLines; count++) {
                              
                              lines[count] = input.readLine();
                    }
                  } catch(Exception e) {
                        e.printStackTrace();
                  }
            } catch (IOException ex) {
                  ex.printStackTrace();
            }
            
            
            
      in below line only 1st line read after that it will come in catch block please let me know where i am wrong.
0
hi how can i set java home in linux
i did this in my /etc/profile
java path
but everytime when i start my vm i have to manual set java home
it always point to this
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

i try this
find /usr/lib/jvm/java-1.x.x-openjdk
find: ‘/usr/lib/jvm/java-1.x.x-openjdk’: No such file or directory

i what to do this
find /usr/lib/jvm/java-1.x.x-openjdk.
vim /etc/profile. ...
Press 'i' to get in insert mode.
add: export JAVA_HOME="path that you found" export PATH=$JAVA_HOME/bin:$PATH.
logout and login again, reboot, or use source /etc/profile to apply changes immediately in your current shell.
0
i have a file .XLS extension but save as XMl spreadsheet 2003 , want to read the file and convert it into .XLS Extension with java code my code is below -

public class ExcelImport {

public boolean readStream(InputStream stream) throws InvalidFormatException {
    boolean success;

    try {
        byte[] bytes = getBytes(stream);
        InputStream wrappedStream = new ByteArrayInputStream(bytes);

        Workbook workbook = WorkbookFactory.create(wrappedStream);
        //XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(wrappedStream.toString()));
        for (int i = 0; i <workbook.getNumberOfSheets(); i++) {
            Sheet sheet = workbook.getSheetAt(i);
            for (Row row : sheet) {
                IterateThroughRow(row);
            }
        }
        success = true;
    } catch (FileNotFoundException e) {
        success = false;
        e.printStackTrace();
    } catch (IOException e) {
        success = false;
        e.printStackTrace();
    }
    return success;
}

private void IterateThroughRow(Row row) {
    Iterator<Cell> cellIterator = row.cellIterator();

    while (cellIterator.hasNext()) {
        Cell cell = cellIterator.next();

        switch (cell.getCellType()) {
            //do something with the content...
            case Cell.CELL_TYPE_STRING:
                cell.getStringCellValue();
                break;
            case Cell.CELL_TYPE_NUMERIC:
                cell.getNumericCellValue();
                break;
 

Open in new window

0
Can someone share the exact steps (step by step) on how to set
X-frame-options in Weblogic (10.3.6, 12.1.3, 12.2.1.3)  & Tomcat
to SAMEORIGIN to fix XFS/clickjacking?


I'm running Solaris 10 & RHEL 6  OS
0
hi how do i add oracle sql data source when creating spring boot application my database in oracle database 12c
spring
0
hi am geting the following error

11 Sep 2019

18:37 All files are up-to-date



18:37 Error running 'All in tdm-pet-clinic': No junit.jar
this is my pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <groupId>guru.springframework</groupId>
    <artifactId>tdm-pet-clinic</artifactId>
    <version>0.0.5</version>
 
    <modules>
        <module>pet-clinic-data</module>
        <module>pet-clinic-web</module>
    </modules>
 
    <packaging>pom</packaging>
 
    <name>tdm-pet-clinic</name>
    <description>SFG Pet Clinic Project</description>
 
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
 
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <jaxb.version>2.3.0</jaxb.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
    </properties>
 
    <dependencies>
        

Open in new window

0
hi am geting the following error

Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/9.0.20
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          May 3 2019 22:26:00 UTC
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.20.0
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Java\jdk1.8.0_111\jre
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_111-b14
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\Desmond\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files\Apache Software …
0
Exploring SharePoint 2016
LVL 19
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

I really must know how to do this. Security on my workstation only allows confirmed downloaded files and no network interaction with Eclipse Marketplace.

So I require ideally a downloaded binary file I can simply drag and drop to install.

Any special instruction would be great.
AGAIN - ABSOLUTELY NO INTERACTION WITH ECLIPSE MARKET PLACE - PRETEND IT DOES NOT EXIST
0
i have a code below where i am traversing a list in jsp containing employee_id and employee_name
<tr>
                                                <td align="top"><INPUT class="inputtext" name="chkBox" type="checkbox" value="<%=employee.get(0)%>" size="50"></td>
                                                <td><label><%=employee.get(0)%></label></td>
                                                <td><label><%=employee.get(1)%></label></td>
</tr>

along with each and every row there is a checkbox when i am selcting chekboxes and click on submit button presently on employee_id (value="<%=employee.get(0)%>") is going along with
checkbox value i want both employee_id and employee_name will go with checkbox value to servlet . in servlet there is a query run and employee_id and
employee_name should be entered into specific table. please help me out on this .please let me know if not clear.
0
HI Team ,

I am retrieving value from database through JDBC statement  my plsql query is below -

Select * from A union Select * from B.

but when i am retrieving value through JDBC statements its give null . when i am individually running query like Select * from A without using Union  its working fine and giving results but when i am using 2 query via Union its give Null. Please tell me where i m wrong .
0
I have written my first Spring MVC controller. While I have no problems with GET requests, I am still having some issues with POST methods.

This is the code in my controller:
@RequestMapping(value = "/editorsWriters", method = RequestMethod.POST)
    public <HttpServletRequest> ResponseEntity<List<FreelancerContactWriterListView>> getEditorsWriters(
                                                                    @RequestParam int[] languageIds, 
                                                                    @RequestParam int[] summaryGroupIds, 
                                                                    @RequestParam String[] writerStates,
                                                                    HttpServletRequest request, HttpServletResponse response) {

        WriterState[] writerState = Arrays.copyOf(writerStates, writerStates.length, WriterState[].class);
        

        List<FreelancerContactWriterListView> writers = writerService.getActiveWriters(languageIds, summaryGroupIds, writerState)
                                                                    .stream()
                                                                    .map(writer -> this.convertTo(writer))
                                                                    .collect(Collectors.toList());

        
           return new ResponseEntity<List<FreelancerContactWriterListView>>(writers, HttpStatus.OK);
    }

Open in new window


and this is the JavaScript code:

 $("#search").on("click", function(e) {
            var languages=$("#languages").val();
            var summaryGroups = $("#summaryGroups").val();
            var writerStates = $("#writerState").val();
            
            var myObject = new Object();
            myObject.languageIds = languages;
            myObject.summaryGroupIds = summaryGroups;
            myObject.writerStates = writerStates;

            var myData = JSON.stringify(myObject);

            console.log(myData);

            $.ajax({
                method: 'POST',
                dataType: 'json',
                data: myData,
                url:'/api/pps/contactFreelancers/editorsWriters',
                contentType: "application/json"
            })
            
        });

Open in new window


This is the JSON sent:

{"languageIds":["1"],"summaryGroupIds":["11"],"writerStates":["PROBATION","REGULAR"]}

Open in new window


The problem is that I get a POST 404 (Not Found) error in the JavaScript console
POST https://dev1.getabstract.com/api/pps/contactFreelancers/editorsWriters 404 (Not Found)

and the following message in the terminal of my IDE:

2019-07-14 22:49:06,923 DEBUG [BaseControllerExceptionHandler] Page not found for the URL https://dev1.getabstract.com/api/pps/contactFreelancers/editorsWriters with query null: Required int[] parameter 'languageIds' is not present

Open in new window



So it is reaching or sending the POST to the correct URL, but what am I doing wrong?

Is the way I have created the data wrong?
languages, summaryGroups and writersStates are all arrays and I am putting them together into one JSON.

Thanks for your help

Massimo
0
It seems that I got the wires crossed & ask you to point me the right direction.

I have a problem with the Eclipse IDE for Enterprise Java Developers (version: 2019-06 (4.12.0), build id: 20190614-1200). There is a code part where I get the error message 'MysqlDataSource cannot be resolved to a type'. Searching the Web, I found out that this class is included in the download of mysql-connector-java JAR 8.0.14 with all dependencies. I added it over the 'Fix project setup…', where I selected the JAR file to the libraries of the Java Build Path.
Java Build Path window with the Libraries tabUnfortunately, the error message does not vanish. Can you see what I am doing wrong? The dialog accepts both JAR & ZIP files.
0
Hi

how to add jar in another spring boot application

I have created one spring application which contain filter i have created that application as a jar and include in another spring boot application .

but that filter is not working ?
jar in Maven dependency i added in pom file also . but it does not call the jar
0
HI,
I have the following curl request and response :

curl 'https://sso.zeapps.in/renw-seseep-alive' -H 'Upgrade-Insecure-Requests: 1'
 -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/74.0.3729.169 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,
image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' -H 'Referer: https://web.zetaapps.in/' 
-H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7' -H 'Cookie:
 __cfduid=dccce009d1b93daca71ebd131558887475; _ga=GA1.2.602226.1587478; _gid=GA1.2.197749.1505258; 
connect.sid=s%3AV74P3e3NKIwARYetmmW3PzXR.wJoT7tQbfUk3GQhMO7OZ026OTDSWsJTMI; _gat=1; 
amplitude_idzetaapps.in=eyJkZXZpY2VJZCI6IjExZmVhMDUwItN1iYTEyLTFhNdCI6ZmFsc2UsInNlc3Npb25JZCI6M
TU2MDE4MjkwNzEzNywibGFzdEV2ZW50VGltZSI6MTU2MDE4Mjk2Mjc4NCwiZXZlbnRJZCI6MCwiaWRlbnRpZnlJ
ZCI6MCwic2VxdWVuY2VOdW1iZXIiOjB9; AWSALB=bIejBRzXqtKh/dsTqgCZyQpUTLqzjm5so+pQUS32gLmQAybM6Dz/8y8IKmD14IPY/o0NVF8+gIjAZSMRFso+
UHL8aT7iehq4WdRaJU0aIX2GF21' --compressed
<p>Found. Redirecting to <a href="https://web.zetaapps.in/#/setup-guide?
authToken=TOVJPQ%3D%3D&amp;trackingCookie=e3NKIwARYetmmW3mvaPqQ2TPzXR&amp;userId=117&amp;
userJID=17%40zeuser.zea.in%2F31&amp;validTill=1560191914368">https://web.zetaapps.in/#/setup-guide?
authToken=T0VJPQ%3D%3D&amp;trackingCookie=e3NKIwARYetmmW3mvaPqQ2TPzXR&amp;userId=117&amp;

Open in new window

0
How to get the request and response  payload in spring handlerinterceptor ?
0
how to create annotation for interceptor

i have created one standalone application which will used by other application for audit .

in my standalone application I have created interceptor which will capture my request and response structure.

I have created this application as jar and i will plane to use in other application ?


other also spring boot application  my question is

1. is interceptor will work if i use as Jar ? no need to use any other code ?
2. if not then how we will create custom annotation for this interceptor ?

Regards,
Sathish Kumar N
0
Learn Ruby Fundamentals
LVL 19
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

I'm trying to change our most Agile development process to include input from the database team.  Our application is a J2EE with a heavy Oracle database transactions; using Hibernate and JPA.  Need help writing a paragraph to justify why I want to make a change to our current development process; where database experts have NO input/involvement until things don't work well or terrible performance.  I want my team to be more proactive in development.
0
Hello guys

I just finished my first course of Java fundamentals.
I have many years of Visual Basic and visual foxpro programming.

Yet I’m confused at how Java is set up (framework) and what can be done and what can not be done.
I’m trying to learn it Step by step.
The question I have for now is the following:if I want a GUI where I can design a screen with buttons and grids etc...
I’m sure it is feasible. But using what Editor ? What version. ?

Sorry if my question seems silly ....
0
Hi Experts,

String xmlStr = "<msg><request><GroupId>001KYL</GroupId><RptCode>68705</RptCode></request> <response><fpath>001KYL/ESUSER2/</fpath></response></msg>"

Open in new window

xmlStr i am getting from DB dynamically,this value will be keep on change.

now i want to convert this string into json format

Thanks
0
I have a very large data file with millions of transaction records. A typical transaction structure will be something like "Transaction ID, Customer ID, and more columns for other details". Transaction ID is unique across the file. Customer ID can repeat as there could be multiple transactions from the same customer, and these can come sequentially or could be distributed across the file. I want to process this file using multithreading. But the condition is that at any given time, only one customer can be processed by any thread which means if any thread is processing a transaction for customer id 100, then no other thread can pick up any other transaction for that customer id 100 till that thread completes processing for the current transaction. I know some synchronization is required around customer id but can someone suggests how we can achieve this in the best manner? The language is java.
0
Q1:
Does  JDK 1.6, JRE 6 & J2EE 1.6 have the same End of Support date (ie beyond
which there's no further patch/support fr Oracle)?

Q2:
I'm looking at JDK 1.8, JRE 8, J2EE 1.8 : what's their End of support date

Q3:
& do they (the 3 items above) simply have a common EoL/EoSL date as Java 8?    

Q4:
So the products that are bundled with above Java items (eg: Weblogic & JBoss)
will have their EoL/EoSL the same as  the versions of bundled Java or usually
they're different & we can update/upgrade the Java components separately?
0
In my shop we continue to be in "database performance hell"; albeit highly suspect our J2EE application code's poor design.  It is well known our application has problems, but at the end of the day everything culminates with the database.  Our application developers use Hibernate, and JPA to interface with our 3-Node Oracle 12c RAC database.

We are generating all of the usually reports ( AWR, ADDM, ASH ) in an attempt to nail down where the problems are.  And, yes the reports have identified 8 or so really bad queries, in some cases with either no recommendation, or recommendations to re-write.  Should have mentioned earlier, the database team does write or generate any of the SQL-queries for the application, these are all originated from the application developers.

We now realize performance should be monitored over a period of time. These reports are not easy to understand and as you know have a huge amounts of information.  Hugely suspect some information is more relevant than others.

 Big question:  if my team needs to focus in on 3-4 items in the AWR, ADDM, ASH reports --which/what items should we set our attention to?
1

Java EE

17K

Solutions

9K

Contributors

Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.

Top Experts In
Java EE
<
Monthly
>