@Override
public void doAction(HstRequest request, HstResponse response) throws HstComponentException {
System.out.println("In Action");
try {
Part part = request.getPart("file");
InputStream fis = part.getInputStream(); // getting null pointer exception as part is null
int content;
while ((content = fis.read()) != -1) {
// convert to char and display it
System.out.print((char) content + "-" + content);
}
}
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
Did you submit the form with POST method and enctype="multiplart/form-data" [1] and <@hst.actionURL/>?
On Fri, Jun 29, 2018 at 11:51 AM, rdjava30 <rdja...@gmail.com> wrote:
Hi Community I try to upload file , but in my action class I am getting null pointer exception.Below is part of my code@Override
public void doAction(HstRequest request, HstResponse response) throws HstComponentException {
System.out.println("In Action");
try {
Part part = request.getPart("file");
InputStream fis = part.getInputStream(); // getting null pointer exception as part is null
int content;
while ((content = fis.read()) != -1) {
// convert to char and display it
System.out.print((char) content + "-" + content);
}}
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
On Friday, June 29, 2018 at 1:05:46 PM UTC-4, woonsan.ko wrote:Did you submit the form with POST method and enctype="multiplart/form-data" [1] and <@hst.actionURL/>?On Fri, Jun 29, 2018 at 11:51 AM, rdjava30 <rdja...@gmail.com> wrote:Hi Community I try to upload file , but in my action class I am getting null pointer exception.Below is part of my code
@Override
public void doAction(HstRequest request, HstResponse response) throws HstComponentException {
System.out.println("In Action");
try {
Part part = request.getPart("file");
InputStream fis = part.getInputStream(); // getting null pointer exception as part is null
int content;
while ((content = fis.read()) != -1) {
// convert to char and display it
System.out.print((char) content + "-" + content);
}}
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.