This may be a simple issue but i am spinning my wheels at this point. I am using the google app engine, and I have a simple jsp that has the following snippit in it
<%#page import="main.java.psbdom.*" %>
....
<%= PS_STRINGS.LABEL %>
and then i have a jar in the WEB-INF/lib dir that has this contents
$ jar -tvf psbdom-0.0.1-SNAPSHOT.jar
0 Tue Feb 07 19:11:36 EST 2012 META-INF/
124 Tue Feb 07 19:11:34 EST 2012 META-INF/MANIFEST.MF
0 Fri Feb 03 20:42:30 EST 2012 main/
0 Fri Feb 03 20:42:30 EST 2012 main/java/
0 Fri Feb 03 20:42:30 EST 2012 main/java/psbdom/
0 Fri Feb 03 20:42:30 EST 2012 main/java/psbdom/constants/
0 Fri Feb 03 20:42:30 EST 2012 main/java/psbdom/data/
0 Fri Feb 03 20:42:30 EST 2012 main/java/psbdom/user/
602 Tue Feb 07 19:11:32 EST 2012 main/java/psbdom/constants/PS_STRINGS.class
this is the PS_STRINGS class
public class PS_STRINGS
{
//public static final String
public static final String LABEL = "LABEL";
...
}
and i get this error
An error occurred at line: 9 in the jsp file: /admin/addConcept.jsp
PS_STRINGS.LABEL cannot be resolved to a type
6: <title>Add Concept</title>
7: </head>
8: <body>
9: <%= PS_STRINGS.LABEL %>
i am really baffled as to what i am doing wrong and any help would be greatly appreciated.
thanks
J
You got the "import.*" wrong, The wildcard (import *) only applies to classes, not to sub-packages.
Try
<%#page import="main.java.psbdom.*, main.java.psbdom.constants.*" %>
Related
I am using jest and react.
I have the following test:
import sut from '../../utils/timeFormater';
describe('timeFormater utils ', () => {
test('hours should be 09 if the getHours method return number less then 10', () => {
const date = new Date('Mon Feb 08 2021 09:18:11 GMT+0100 (Central European Standard Time');
const result = sut(date);
expect(result.split(':')[0]).toBe('09');
});
});
after my deployment on the server - there the time is one hour earlier so
when i expect - expect(result.split(':')[0]).toBe('09');
it is working on my local machine
but it is not working on the deployed serrver - there the tests are failing because there
it receives 08 instead 09 for
const date = new Date('Mon Feb 08 2021 09:18:11 GMT+0100 (Central European Standard Time');
how can i solve this issue ?
I'm fairly new to Ionic so please bear with me.
I've managed to create a very simple array called Events that has another small array inside it:
$key: "12345566778"
dates: Array(3)
0: Tue Feb 23 2021 00:00:00 GMT+0000 (Greenwich Mean Time) {}
1: Wed Feb 24 2021 00:00:00 GMT+0000 (Greenwich Mean Time) {}
2: Thu Feb 25 2021 00:00:00 GMT+0000 (Greenwich Mean Time) {}
title: "Quality"
startDate: "2021-02-23"
$key: "314351632623"
dates: Array(3)
0: Wed Feb 17 2021 00:00:00 GMT+0000 (Greenwich Mean Time) {}
1: Thu Feb 18 2021 00:00:00 GMT+0000 (Greenwich Mean Time) {}
2: Fri Feb 19 2021 00:00:00 GMT+0000 (Greenwich Mean Time) {}
title: "Equality"
startDate: "2021-02-17"
What I really want to do is display them in an list in the following format:
Quality
- Tue Feb 23 2021
- Wed Feb 24 2021
- Thu Feb 25 2021
Equality
- Wed Feb 17 2021
- Thu Feb 18 2021
- Fri Feb 19 2021
But at the moment I only know how to cycle through the events array with one ngFor, which isn't what I'm wanting to do:
<ion-select-option *ngFor="let event of Events" value="{{event.title}} - {{event.startDate}}">{{event.title}} - {{event.startDate}}</ion-select-option>
Does anyone know how I can achieve this please?
You just need to nest another loop to achieve that. It'd look like this:
<ion-item *ngFor="let event of Events">
<ion-label>{{ event.title }}</ion-label>
<ion-select>
<ion-select-option *ngFor="let eventDate of event.dates" [value]="eventDate">
{{ eventDate | date:'EEE LLL dd yyyy' }}
</ion-select-option>
</ion-select>
</ion-item>
You'd probably need to edit that code based on your specific UI, but the main idea is to have one loop for the events, and another loop for the dates on each event.
Please also notice that I'm using the Angular date pipe to format the eventDate (https://angular.io/api/common/DatePipe)
EDIT:
I'm trying to get all the results sitting within one ion-select, each as an option. Then I was going to make the titles unselectable and the whole thing multiple choice but that's not really important here.
For some reason I assumed you wanted multiple ion-selects but that makes perfect sense.
In that case, you can use <ng-container></ng-container> to create a nested loop without creating an element that will be rendered in the view.
I think something like this should work (I'm editing the code directly in the browser so you may need to fix a few things, but the main idea at least should be clear).
<ion-item>
<ion-label>Options</ion-label>
<ion-select>
<ng-container *ngFor="let event of Events">
<!-- Title -->
<ion-select-option disabled="true">
{{ event.title }}
</ion-select-option>
<!-- Options -->
<ion-select-option *ngFor="let eventDate of event.dates" [value]="eventDate">
{{ eventDate | date:'EEE LLL dd yyyy' }}
</ion-select-option>
</ng-container>
</ion-select>
</ion-item>
I am using Date() function in my react code. Date function is running on chrome fine but working on firefox.
I have tried to convert the date in miliseconds.
var getnewdate = "Wed Jun 26 2019 00:00:00 GMT+0530 (India Standard Time)";
alert(getnewdate);
var getCurrentDayInMilli = new Date(getnewdate).getTime() / 100000;
alert(getCurrentDayInMilli);
alert(getnewdate); prints "Tue Jun 25 2019 00:00:00 GMT+0530 (India Standard Time)" on chrome which is correct but on firefox it prints "Invalid Date" which is not correct.
I want my alert function should work fine in firefox as well like chrome.
Use date in this format yyyy/MM/dd(you can have any format of date) HH:mm:ss(this is required), this will work in all the browsers,
var getselectdate = "Jun-27-2019 12:00:00";
In AngularJS i.e in controller.js file I am retrieving the date from database in this format i.e "Mon Mar 14 2014 00:00:00 GMT+0530 (IST)". But when I display this date using AngularJS datepicker on html page it is showing empty means it is not showing the date with this format i.e 2014-03-08.
Here's example on how to convert date format using moment js
<div id="date"></div>
<div id="momentdate"></div>
<script>
$(document).ready(function () {
var d = new Date(); //Sat Mar 05 2016 17:48:48 GMT+0530 (India Standard Time)
$('#date').text(d);
var md = moment(d).format('YYYY-MM-DD');
$('#momentdate').text(md);
});
</script>
output
Sat Mar 05 2016 17:48:48 GMT+0530 (India Standard Time)
2016-03-05
working example on jsfiddle
I have been switching from Google App Engine MailServier to the GMail API recently and I'm running into a strange issue:
The emails are being sent out correctly, but on the recipients end the body is empty! (Subject is still there).
I'm creating HTML emails with optional attachments and encode them using the snippet from the GMail API docs:
I'm using the snippet from the GMail API docs to encode the email:
public static Message createMessageWithEmail(MimeMessage email)
throws MessagingException, IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
email.writeTo(baos);
String encodedEmail = Base64.encodeBase64URLSafeString(baos.toByteArray());
Message message = new Message();
message.setRaw(encodedEmail);
return message;
}
When looking into my "Sent" folder in GMail, I can see the message just fine (it is an HTML email body):
Received: from 889121556365-na05chj5g3il9flll2l3otqeh7q7ja22.apps.googleusercontent.com
named unknown
by gmailapi.google.com
with HTTPREST;
Thu, 18 Jun 2015 05:29:12 -0400
From: daniel.florey#gmail.com
To: daniel.florey#floreysoft.net
Message-Id: <CAHWc4t9o6gpRs_HT0Y8E1szJtDTwfSMS7OH+jVro-LiA1kBLJw#mail.gmail.com>
Subject: Test
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1_15413936.1434619752068"
Date: Thu, 18 Jun 2015 05:29:12 -0400
------=_Part_1_15413936.1434619752068
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
------=_Part_1_15413936.1434619752068
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
TnVyIGVpbiBUZXN0ITxkaXY+PGJyPjwvZGl2PjxkaXY+PGZvbnQgc2l6ZT0iNiI+SGFoYWhhITwv
Zm9udD48L2Rpdj4=
------=_Part_1_15413936.1434619752068--
On the recipients end the same message is empty:
Delivered-To: daniel.florey#floreysoft.net
Received: by 10.140.94.46 with SMTP id f43csp925254qge;
Thu, 18 Jun 2015 02:29:13 -0700 (PDT)
X-Received: by 10.180.94.39 with SMTP id cz7mr61405623wib.66.1434619752847;
Thu, 18 Jun 2015 02:29:12 -0700 (PDT)
Return-Path: <daniel.florey#gmail.com>
Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com. [2a00:1450:400c:c05::233])
by mx.google.com with ESMTPS id ju2si35306720wid.33.2015.06.18.02.29.12
for <daniel.florey#floreysoft.net>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 18 Jun 2015 02:29:12 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.florey#gmail.com designates 2a00:1450:400c:c05::233 as permitted sender) client-ip=2a00:1450:400c:c05::233;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of daniel.florey#gmail.com designates 2a00:1450:400c:c05::233 as permitted sender) smtp.mail=daniel.florey#gmail.com;
dkim=pass header.i=#gmail.com;
dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Received: by wicgi11 with SMTP id gi11so7511413wic.0
for <daniel.florey#floreysoft.net>; Thu, 18 Jun 2015 02:29:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=from:mime-version:date:message-id:subject:to:content-type;
bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
b=aYXfdO2NjbNXjQglJuER7ul/PfgQ84kxfMtDvUr4XEYuYEEhOZzWTiBj4Aedq8xtrH
5upGVtwKjHVc0R36BcFUD0tTq5IXLXsESIMEXL0pV0KJCFnXvMRCC+rn0uUzbCVWcSp4
LG8RxP9YTWRMhWQUattO/vI43kV34EMLax+irhY+98pXkaHHrNd5+GGO2OMzdcRPOpCg
gZ9bdQeEDsSrW4YJrxdKA/hJfCh6ceZ9mDgeRPiD+tC9AibhPK1QDqM8SKzh1QRoSZtl
yPGyJWGUXYMM9o7XaCh8ZenKLvd/AdTF2oAbwyqXnycAvOZqqj03x4sA38o5c4fEjkIQ
rAxQ==
X-Received: by 10.180.72.176 with SMTP id e16mr26991312wiv.12.1434619752466;
Thu, 18 Jun 2015 02:29:12 -0700 (PDT)
Received: from 889121556365-na05chj5g3il9flll2l3otqeh7q7ja22.apps.googleusercontent.com
named unknown by gmailapi.google.com with HTTPREST; Thu, 18 Jun 2015 05:29:12 -0400
From: daniel.florey#gmail.com
MIME-Version: 1.0
Date: Thu, 18 Jun 2015 05:29:12 -0400
Message-ID: <CAHWc4t9o6gpRs_HT0Y8E1szJtDTwfSMS7OH+jVro-LiA1kBLJw#mail.gmail.com>
Subject: Test
To: daniel.florey#floreysoft.net
Content-Type: text/plain; charset=UTF-8
The content type has been switched to text/plain?!
Any ideas?