我需要一些帮助,我想做一个程序并使用
if(session.getAttribute("logged")!="1"){
String err="You must be logged in!!";
request.setAttribute( "error", err );
String nextJSP = "/login.jsp";
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
dispatcher.forward(request,response); }
Run Code Online (Sandbox Code Playgroud)
%>
在一个jsp中,但我的老板告诉我使用jstl所以我把它改为:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:if test="${session.getAttribute('logged')!=null}">
<jsp:forward page="login.jsp">
</jsp:forward>
</c:if>
<c:if test="${session.getAttribute('logged')==null}">
<jsp:forward page="princ.jsp"> </jsp:forward>
</c:if>
Run Code Online (Sandbox Code Playgroud)
我得到一个令人讨厌的错误:
"org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application "
Run Code Online (Sandbox Code Playgroud)
我在互联网上搜索了一些修复,我把javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar放在我的库中,甚至将javaee.jar放在Tomcat库中,但仍然没有得到解决方案这个,有人可以帮帮我吗?PS:我为Web开发人员提供了Eclipse Java EE IDE.(INDIGO)Tomcat 7.08
是否有可能制作一个网格视图,而不是图片网格,每个网格下面都有一个小图像按钮的图片网格?
我注意到目前已弃用了LocationClient类.我正在使用它作为旅行应用程序.我改变逻辑使用LocationServices而不是LocationClient:https: //developer.android.com/reference/com/google/android/gms/location/LocationServices.html
现在问题是我无法从LocationServices.Geofence或GoogleApiClient获取getTriggeringGeofences和getGeofenceTransition.我怎么做?
这是我的旧BroadcastReceiver的代码:
int transitionType = LocationClient.getGeofenceTransition(intent);
if(transitionType == Geofence.GEOFENCE_TRANSITION_EXIT) {
List<Geofence> triggerList = LocationClient.getTriggeringGeofences(intent);
for (Geofence geofence : triggerList) {
Log.i("", "geof: " + transitionType + " GPS zone " + geofence.getRequestId());
if(geofence.getRequestId().contentEquals("1")) {
Utils.appendLog("GEOFENCE: exited current position GPS Zone");
MyApp.getInstance().disableGeofence();
addLoc();
}
}
}else if (transitionType == Geofence.GEOFENCE_TRANSITION_ENTER){
List<Geofence> triggerList = LocationClient.getTriggeringGeofences(intent);
for (Geofence geofence : triggerList) {
Log.i("", "geof: " + transitionType + " GPS zone " + geofence.getRequestId());
if(geofence.getRequestId().contentEquals("2")) {
Utils.appendLog("GEOFENCE: entered destination …Run Code Online (Sandbox Code Playgroud) android location android-geofence location-client location-services
我现在使用Crashlytics的Fabric和Beta一段时间了,它完美无缺.该应用程序的iOS版本有一个对话框,当您启动应用程序时会弹出该对话框,如果Beta中有另一个较新版本的应用程序,则会安装该应用程序.我需要在Android中实现这一点,但我找不到任何关于如何实现这一点的文档.有没有人设法在Android上实现这一点?
这是什么意思,可以以某种方式修复?不是在我的代码中崩溃,而是在 FragmentActivity 的超级中,我无法弄清楚我做错了什么:
Fatal Exception: java.lang.IllegalArgumentException
at android.os.Parcel.readException(Parcel.java:1688)
at android.os.Parcel.readException(Parcel.java:1637)
at android.app.ActivityManagerProxy.isTopOfTask(ActivityManagerNative.java:5505)
at android.app.Activity.isTopOfTask(Activity.java:5983)
at android.app.Activity.onResume(Activity.java:1253)
at android.support.v4.app.FragmentActivity.onResume(FragmentActivity.java:485)
at nl.hgrams.passenger.activities.PSTimelineFragmentsActivity.onResume(PSTimelineFragmentsActivity.java:576)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
at android.app.Activity.performResume(Activity.java:6788)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:2844)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2858)
at android.app.ActivityThread.-wrap15(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1575)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Run Code Online (Sandbox Code Playgroud)
这是我的 onResume():
@Override
protected void onResume() {
super.onResume();
registerReceiver(addedPitstopBroadcastReceiver,
new IntentFilter("addedPitstop"));
if (PSApplicationClass.getInstance().pref.getUserId(PSTimelineFragmentsActivity.this) != null) {
renewSettings();
PSApplicationClass.getInstance().pref.setIsBackground(this, false);
if (PSApplicationClass.getInstance().pref.isRefetchUser(PSTimelineFragmentsActivity.this)) {
PSApplicationClass.getInstance().pref.setRefetchUser(PSTimelineFragmentsActivity.this, false);
MyFirebaseInstanceIDService.changeFirebaseToken(PSTimelineFragmentsActivity.this);
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是直接在onResume崩溃了,所以没有传到下一行。也试图重现我,但不能。用户有一台:LG G-Pad 8.3
![1]](https://i.stack.imgur.com/Jk3qQ.png)
android onresume android-lifecycle android-fragments android-fragmentactivity
这是我使用的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top|center_horizontal"
android:background="@color/white"
android:gravity="top|center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/provisioningTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Phone Number" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是我创建对话框的类:
open class DialogProvisioningData : BottomSheetDialog {
constructor(context: Context) : super(context)
private lateinit var mBehavior: BottomSheetBehavior<FrameLayout>
override fun setContentView(view: View) {
super.setContentView(view)
val bottomSheet = window.decorView.findViewById<View>(R.id.design_bottom_sheet) as FrameLayout
mBehavior = BottomSheetBehavior.from(bottomSheet)
mBehavior.peekHeight = Resources.getSystem().getDisplayMetrics().heightPixels
mBehavior.state = BottomSheetBehavior.STATE_EXPANDED
}
override fun onStart() {
super.onStart()
mBehavior.peekHeight = Resources.getSystem().getDisplayMetrics().heightPixels
mBehavior.state = BottomSheetBehavior.STATE_EXPANDED
}
companion object {
fun newInstance(context: Context): DialogProvisioningData {
val …Run Code Online (Sandbox Code Playgroud) 我有一个视频播放,在某些时候,我需要暂停视频,拍摄,然后使用该图像,在绘画活动中修改它.问题是,如果我试图保存视频,图片将是黑色的(尝试过setDrawingCacheEnabled(true);)........是否可以拍摄视频的屏幕截图?
我可以画它的路径,我用手指移动用透明线删除,或者根本不画画?
这是我实例化我的橡皮擦的方式:
OnClickListener eraseListener = new OnClickListener() {
@Override
public void onClick(View v) {
mPaint.setColor(0x00000000);
mPaint.setXfermode(clear);
mPaint.setAlpha(0x00);
myView.setPaint(mPaint);
LogService.log("PaintActivity", "------in eraseListener");
}
};
Run Code Online (Sandbox Code Playgroud)
这将从包含画布的View中设置绘画.在这里,我有以下动议事件:
private void touch_start(float x, float y) {
mPath.reset();
mPath.moveTo(x, y);
mX = x;
mY = y;
}
private void touch_move(float x, float y) {
float dx, dy;
dx = Math.abs(x - mX);
dy = Math.abs(y - mY);
if ((dx >= TOUCH_TOLERANCE) || (dy >= TOUCH_TOLERANCE)) {
undoPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) …Run Code Online (Sandbox Code Playgroud) 现在,我需要点击一个按钮,然后用该按钮通过facebook提醒激活登录.
现在,直到现在,我已经使用了旧代码,但是已经弃用了,所以我需要使用新的代码,这是我无法理解的.它在哪里使用APP_ID字符串?现在我拿了HelloFacebookSample和SessionLoginSample,但是当我尝试在手机上运行它们时它们都崩溃了.然后我尝试了这段代码:https: //developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/ 但它也是如此.
这就是logcat所说的:
03-13 14:55:46.497: E/AndroidRuntime(28849): java.lang.RuntimeException: Unable to start activity ComponentInfo{ro.koolnet.android/ro.koolnet.android.ui.activities.LoginActivity}: java.lang.NullPointerException: Argument applicationId cannot be null
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2190)
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2215)
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.app.ActivityThread.access$600(ActivityThread.java:145)
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1211)
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.os.Handler.dispatchMessage(Handler.java:99)
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.os.Looper.loop(Looper.java:137)
03-13 14:55:46.497: E/AndroidRuntime(28849): at android.app.ActivityThread.main(ActivityThread.java:4978)
03-13 14:55:46.497: E/AndroidRuntime(28849): at java.lang.reflect.Method.invokeNative(Native Method)
03-13 14:55:46.497: E/AndroidRuntime(28849): at java.lang.reflect.Method.invoke(Method.java:511)
03-13 14:55:46.497: E/AndroidRuntime(28849): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
03-13 14:55:46.497: E/AndroidRuntime(28849): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
03-13 14:55:46.497: …Run Code Online (Sandbox Code Playgroud) 正如标题所示,我需要禁用这些按钮,我附上应用程序的屏幕截图,以便您可以看到我在说什么.

这可能吗?
android ×9
paint ×2
adaptor ×1
beta ×1
bottom-sheet ×1
canvas ×1
capture ×1
crashlytics ×1
dialog ×1
eclipse ×1
erase ×1
facebook ×1
google-maps ×1
gridview ×1
icons ×1
imagebutton ×1
jsp ×1
jstl ×1
layout ×1
location ×1
login ×1
markers ×1
onresume ×1
path ×1
screen ×1
sdk ×1
session ×1
taglib ×1
updates ×1
video ×1